Consider the following two tables: Tablel: Customers customerID Fname 100 101 Lname Amri Kalabani Harthi Alshukaili Rawas City salma@gmail.com Salalah Rami@hotmail.com Sohar Adnan@yahoo.com Sur Amro@gmail.com Bahla Maataz@gmail.com Salalah ZipCode 211 email Salma Rami 205 102 Adnan 201 103 Amro 208 104 Maatz 211 Table2: Orders orderID 1 amount customerID 234$ orderDate 07/04/2019 100 03/14/2020 78$ 103 3 05/23/2019 124$ 102 07/21/2018 25$ 104 6. 11/27/2019 14$ 102 7 12:07/2020 55$ 106 Draw three tables that can result by executing each of the following SQL statements. (Put your answer in a document word then upload it).
Q: Q2/ Consider the following table is used to store contact information: Name Company Address Phonet…
A: The table is not normalized because there are 3 phone numbers for Joe and 2 phone numbers for Chris.…
Q: Which query identifies customers living in the same state as the customer namedLeila Smith?a. SELECT…
A: Here we need to find the state of Leila Smith, that is FirstName should be Leila AND LastName is…
Q: Display the maximum price of all the products in PRODUCTS table for each Supplier ID having a…
A: Here we need to join Table Supplier and PID. Since they have common attribute,they can be joined…
Q: Write an SQL query for the following questions: List the name of doctors with the number of written…
A: List the name of doctors with the number of written prescriptions SELECT dd.first_name, dd.last_name…
Q: Which of the following is FALSE for the given ERD? Select one: O a.Three tables should be created…
A: Country table has primary key Cname.
Q: n by "query optim
A: Query Optimization: The process of selecting an efficient execution plan for evaluating a query is…
Q: Consider the following two tables: Table1: Customers customerID Fname Lname…
A: SELECT c.Fname, c.Lname, c.email, o.orderDate, o.amount FROM Customers AS c…
Q: Use the following schema and query plan to answer the corresponding questions S(d,e,f,g) B(S) = 1000…
A: I'm providing the answer to above question. I hope this will be helpful for you.
Q: SQL Injection: Question: What command retrieves a list of tables where the user passwords can be…
A: SQL commands are instructions given to the database to perform different operations on it. Commands…
Q: table1 ID Text 1 Finance Manager 2 Accountant 3 Office Manager table2 ID Text 1 Sales Manager 2…
A: GIVEN THAT There are 2 tables Table1 and Table 2 with id and text and we have to fetch the…
Q: Write SQL query to create a table: Product (PID VARCHAR(10), PNAME VARCHAR(10), PRICE INTEGER,…
A: Given Table: Product (PID VARCHAR(10), PNAME VARCHAR(10), PRICE INTEGER, QUANTITY INTEGER) List Of…
Q: ESTION 19 ive the following tables: Supplier SupplierID ContactPerson phone SupName Abc company…
A: As per Bartleby guidelines “Since you have posted a question with multiple sub-parts, we will solve…
Q: Q2/ Consider the following table is used to store contact information: Name Company Address Phone1…
A: The table is not normalized because there are 3 phone numbers for Joe and 2 phone numbers for Chris.…
Q: Refer the given tables and answer the question that follow: Table : PURCHASE_ORDER ORDER_NO AMOUNT…
A: Answer: a) SELECT * FROM PURCHASE_ORDER; SELECT ORDER_NO,ORDER_DATE FROM PURCHASE_ORDER WHERE…
Q: Write an SQL query for the following questions: List the most prescribed medicines in the ascending…
A: given: Write an SQL query for the following questions: List the most prescribed medicines in…
Q: Q.No.1. Write the SQL queries. Employee: Empno Address Rawalpindi Emp name Ali Salary 5,000 Deptno…
A: SQL is a query language that is used to write the SQL query statements on tables of a database. The…
Q: Name the candidate keys in the following table: Student L number Student_Name Student SS Number…
A: a candidate key is a super key which has no redundant attribute.
Q: 1. Customers and internet packages (Customers and Packages tables) a. Write a query to display…
A: On understanding the relational model from Edgar F. Codd in the early 1970s, Donald D. Chamberlin…
Q: 17. Create a basic ERD for the given tables: Table name: CUSTOMER Table name: INVOICE CUST NUM CUST…
A: An entity relationship model portrays interrelated things of interest in a particular space of…
Q: Sql server 2012 query question Make the following queries?…
A: Select Those Hospital whose district is Karachi and Hyderabad Select…
Q: • https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all A) Work on the “Products"…
A: SELECT CategoryID, AVG(Price) AS "AVG Price" FROM Products GROUP BY CategoryID;
Q: Given the table: emp [eid, ename, salary, d_id] The following query retrieve the department name…
A: The table: emp [eid, ename, salary, d_id] The query: select d_name from dep where d_id = ( select…
Q: Select Those Hospital whose district is Dehli and Hyderabad Select Those Doctors That are from…
A: The SQL (Structured Query Language) can be created for the specified scenario. To fetch all rows…
Q: Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table?…
A: Tables are database objects that contain all the data in a database. In tables the data is logically…
Q: Sql server 2012 query question Make the following queries?…
A: As per Bartleby's guidelines: “Since you have posted a question with multiple sub-parts, we will…
Q: Query 2: Write a query to display every member in Ohio who made a payment greater than or equal to…
A: Select (First name, Lastname) from Payment where State = "Ohio" AND Amount>=300; The above…
Q: For the below given schema diagram develop a SQL query to find the guest name whose total bill…
A: According to the given problem statement we are required to develop a SQL query to find the guest…
Q: Given the following table TABLE CUSTOMER Column Null? Туре CUS_ID NOT NULL NUMBER NAME VARCHAR2(50)…
A: In SQL, the SELECT statement can be applied to fetch records from any relation. It can display…
Q: Which query in this relational database (represented by relational diagram) will provide you with…
A: The query database feature is as important as data storage capability. Hence, a variety of query…
Q: True or False for each of the following : 1- ROP in Oman is planning to open various branches in…
A: As per our company guidelines we are supposed to answer ?️only first 3️⃣ sub-parts.Kindly repost…
Q: Write a query to create client table schema in such a way that if we delete row from parent, its…
A: NOTE : AS PER GUIDELINES, WE ARE AUTHORIZED TO ANSWER 3 SUB PARTS. REPOST OTHER PARTS. 1. create…
Q: For the below given schema diagram develop a SQL query to find the guest name whose total bill…
A: According to the given problem statement we are required to develop a SQL query to find the guest…
Q: Add the following values in the table Doctor id Doctor_name Degree Join_year Salary D550 Saleh…
A: 4. Show the doctor's names, degree and salary for all doctors who hoint between 2010 and 2015 select…
Q: Customers customer_id address_id PK Addresses FK address_id city PK first_name last_name phone state…
A: We need to write a trigger for all modification on table named Goods for U;pdate and Delete…
Q: 10) What type of connection is used in the following query select category_name, first_name…
A: Consider the given Query: select category_name, first_name from Child, Size_ group where…
Q: *SQL Query Required* Display schedule_id, source, destination and travel_time which has minimum…
A: Given in the above question that:Develop a SQL query to display schedule_id, source, destination and…
Q: Wil you plz show me an examle of how to connect a mvc5 with an sql server
A: Will you plz show me an example of how to connect a mvc5 with an sql server Answer: This will…
Q: What are the customer IDs and names of all customers, along with the order IDs for all the orders…
A: SQL (Structured Query Language) is designed primarily for managing data in a relational database…
Q: Q14) how many products with price < 10
A: You have asked multiple questions so we will solve the first one for you. If you want any other…
Q: Write SQL Queries for following Emp table : EMPLOYEE_ID Name EMAIL HIRE_DATE SALARY DEPARTMET 1001…
A: Table created using INSERT INTO Emp (employee_id,name,email,hire_date,salary,departmet)VALUES(1001,…
Q: Q2: Insert the following data in the following tables: A. carrier CarrierID CarrierName Phone range…
A: INSERT is the keyword used to insert a row into a table and let's see the statements to insert…
Q: Write an SQL query for the following questions: List the name of doctors with the number of written…
A: Structured Query Language is abbreviated as SQL or also pronounced as See-Qwell. It is developed for…
Q: DateOf Empld FullIName Managerld City Joining 121 John Snow 321 01/31/2014 Toronto 321 Walter White…
A: Initial Data Present Table: EMPLOYEE CREATE TABLE `EMPLOYEE` ( `EmpId` int(11) NOT NULL,…
Q: Study the two tables below and answer the questions that follow. Using the relational operator left…
A: Here in this question we have given two table and we have asked to perform left outer join on these…
Q: 1. Create the following two tables with Proper Relationship TABLE NAME CUSTOMER88 FIELD NAME DATA…
A: Create table with proper relationship: In a database system, ONE-TO-MANY relationship will link two…
Q: A query of the table information for table Supplier returns the following information: Icid name…
A: SQL (Structured Query Language) is a database query language. According to ANSI, it is the…
Q: The query that will show the customer records sorted according to region_id SELECT * FROM customer…
A: The correct option is c) SELECT * FROM customer ORDER BY region_id
Q: Why i cant insert thinks into the tables this is my code
A: Error found in the create query of employee
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- The table VideoVisitFact has a single primary key column of VideoVisitKey. The column is numeric. Which of the following returns the number of rows in the VideoVisitFact table? A. SELECT MAX (VideoVisitKey) FROM VideoVisitFact B. SELECT COUNT (*) FROM VideoVisitFact C. SELECT (*) FROM VideoVisitFact D. SELECT SUM(VideoVisitKey) FROM VideoVisitFactConsider the following two tables: Table1: Customers customerID Fname Lname email City ZipCode 100 Salma Amri salma@gmail.com Salalah 211 101 Rami Kalabani Rami@hotmail.com Sohar 205 102 Adnan Harthi Adnan@yahoo.com Sur 201 103 Amro Alshukaili Amro@gmail.com Bahla 208 104 Maatz Rawas Maataz@gmail.com Salalah 211 Table2: Orders orderID orderDate amount customerID 1 07/04/2019 234$ 100 2 03/14/2020 78$ 103 3 05/23/2019 124$ 102 5 07/21/2018 25$ 104 6 11/27/2019 14$ 102 7 12/07/2020 55$ 106 Draw three tables that can result by executing each of the following SQL statements. (Put your answer in a document word then upload it). 1. SELECT c.Fname, c.Lname, c.email, o.orderDate, o.amount FROM Customers AS c INNER JOIN Orders AS o ON c. customerID = o. customerID;…Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, partial primary key, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL, partial primary key If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically. Sent from Mail for Windows
- Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, partial primary key, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL, partial primary key If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically.SQL: Dog DataIn each question below, you will define a new table based on the following tables.CREATE TABLE parents ASSELECT "abraham" AS parent, "barack" AS child UNIONSELECT "abraham" , "clinton" UNIONSELECT "delano" , "herbert" UNIONSELECT "fillmore" , "abraham" UNIONSELECT "fillmore" , "delano" UNIONSELECT "fillmore" , "grover" UNIONSELECT "eisenhower" , "fillmore";CREATE TABLE dogs ASSELECT "abraham" AS name, "long" AS fur, 26 AS height UNIONSELECT "barack" , "short" , 52 UNIONSELECT "clinton" , "long" , 47 UNIONSELECT "delano" , "long" , 46 UNIONSELECT "eisenhower" , "short" , 35 UNIONSELECT "fillmore" , "curly" , 32 UNIONSELECT "grover" , "short" , 28 UNIONSELECT "herbert" , "curly" , 31;CREATE TABLE sizes ASSELECT "toy" AS size, 24 AS min, 28 AS max UNIONSELECT "mini" , 28 , 35 UNIONSELECT "medium" , 35 , 45 UNIONSELECT "standard" , 45 , 60;Q1: Size of DogsThe Fédération Cynologique Internationale classifies a standard poodle as over 45 cm and up to 60 cm.The sizes table…SQL: Dog DataIn each question below, you will define a new table based on the following tables.CREATE TABLE parents ASSELECT "abraham" AS parent, "barack" AS child UNIONSELECT "abraham" , "clinton" UNIONSELECT "delano" , "herbert" UNIONSELECT "fillmore" , "abraham" UNIONSELECT "fillmore" , "delano" UNIONSELECT "fillmore" , "grover" UNIONSELECT "eisenhower" , "fillmore";CREATE TABLE dogs ASSELECT "abraham" AS name, "long" AS fur, 26 AS height UNIONSELECT "barack" , "short" , 52 UNIONSELECT "clinton" , "long" , 47 UNIONSELECT "delano" , "long" , 46 UNIONSELECT "eisenhower" , "short" , 35 UNIONSELECT "fillmore" , "curly" , 32 UNIONSELECT "grover" , "short" , 28 UNIONSELECT "herbert" , "curly" , 31;CREATE TABLE sizes ASSELECT "toy" AS size, 24 AS min, 28 AS max UNIONSELECT "mini" , 28 , 35 UNIONSELECT "medium" , 35 , 45 UNIONSELECT "standard" , 45 , 60; Q2: By Parent HeightCreate a table by_parent_height that has a column of the names of all dogs that have a parent,ordered by the height…
- SQL: Dog DataIn each question below, you will define a new table based on the following tables.CREATE TABLE parents ASSELECT "abraham" AS parent, "barack" AS child UNIONSELECT "abraham" , "clinton" UNIONSELECT "delano" , "herbert" UNIONSELECT "fillmore" , "abraham" UNIONSELECT "fillmore" , "delano" UNIONSELECT "fillmore" , "grover" UNIONSELECT "eisenhower" , "fillmore";CREATE TABLE dogs ASSELECT "abraham" AS name, "long" AS fur, 26 AS height UNIONSELECT "barack" , "short" , 52 UNIONSELECT "clinton" , "long" , 47 UNIONSELECT "delano" , "long" , 46 UNIONSELECT "eisenhower" , "short" , 35 UNIONSELECT "fillmore" , "curly" , 32 UNIONSELECT "grover" , "short" , 28 UNIONSELECT "herbert" , "curly" , 31;CREATE TABLE sizes ASSELECT "toy" AS size, 24 AS min, 28 AS max UNIONSELECT "mini" , 28 , 35 UNIONSELECT "medium" , 35 , 45 UNIONSELECT "standard" , 45 , 60; Q3: SentencesThere are two pairs of siblings that have the same size. Create a table that contains a row with a string foreach of…Create the ROOMS table using the specification below: Table Name: ROOMS Field Name/ Data Type Size Constraints column name RID Number 8 PRIMARY KEY RType Varchar2 25 NOT NULL Rate Number Bedroom Number 5 Room Status Varchar2 10 REFERENCES to CID in Clients Table CID NumberTable : PURCHASE_ORDER ORDER_NO AMOUNT ORDER DATE CUSTOMER_ID SALESMAN_ID DELIVERY DATE 1001 300 05-03-2017 2001 3001 05-05-2017 1002 200.20 10-07-2017 2002 3003 10-10-2017 1003 600 12-06-2017 2005 3002 12-08-2017 1004 400.25 10-05-2017 2003 3004 10-07-2017 1005 500.10 03-08-2017 2004 3005 03-05-2017 1006 400 10-07-2017 2005 3006 10-10-2017 Table: PURCHASE _DETAILS ORDER_NO PRODUCT_NAME PRICE QUANTITY 1001 KEYBOARD 56 100 1002 MONITOR 36 200 1003 MOUSE 100 1004 HARD_DISK 58 300 1005 RAM 25 500 1007 CABINET 100 a) Write a SQL query to display PRODUCT_NAME, ORDER DATE and find number of years between the DELIVERY_ DATE from the CURRENT DATE [Hint: Use ON Clause]. b) Write a SQL query to display matched records from PURCHASE_ORDER table and all records from PURCHASE_DETAILS. c) Write an SQL query to display ORDER_NO, PRODUCT_NAME from table ORDER_DETAILS of products where the price is less than average price of products. [Hint: Use Subquery]. d) Write an SQL query to display ORDER_NO,…
- Create a SQL statement for the CLIENTS table using the table structure below: Table Name: CLIENTS Field Name/ column name Data Type Size Constraints CID Number 8 PRIMARY KEY CName Varchar2 25 NOT NULL Gender Varchar2 10 Validate to accept Male or Female only Address Varchar2 25 Contact Number 15 CType Varchar2 15Examine this product table's column definitions:pid number primary keypname varchar2(50)You must display column headings as shown:Product_ID Product NameWhich SELECT statement does this? SELECT pid Product_ID, pname Product Name FROM product; SELECT pid Product_ID, pname "Product Name" FROM product; SELECT pid @Product_ID, pname @"Product Name" FROM product; SELECT pid AS Product_ID, pname AS Product Name FROM product5. In the OrderItems table, display a count of the number of products where item_price is greater than or equal to $6, grouped by prod_id, but only for those groups having 3 or more of a given prod_id. Display the count with the alias shown. Sort by prod_id in ascending order. BRO3 1 rows returned in 0.03 seconds PROD ID Download 4 NUM PROD ID