Question

You will need to refer to the University database to answer this question. Write SQL queries to perform the following operations. each case show the SQL statement you used and the output from MySQL. You are required to include screenshots showing the actu output of your queries. The tables of University database are as follows: region (region_number, address, telephone, email _address) staff (staff number, name, address, email_address, telephone,

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

-- e)

SELECT student_id, course_code

FROM examination E

WHERE NOT EXISTS(

SELECT student_id

FROM assignment A

WHERE E.student_id=A.student_id AND E.course_code = A.course_code

);

-- f)

SELECT S.student_id, name, mark

FROM student S, assignment A

WHERE S.student_id = A.student_id AND A.mark = (

SELECT MAX(mark)

FROM assignment

);

-- g)

SELECT R.region_number, telephone, COUNT(*) AS no_of_students

FROM region R, student S

WHERE R.region_number = S.region_number

GROUP BY region_number, telephone

HAVING COUNT(*)<5;

-- h)

CREATE TABLE Faculty(

Staff_number CHAR(4) NOT NULL PRIMARY KEY,

Faculty_name VARCHAR(40),

Address VARCHAR(120),

Email_address VARCHAR(40),

Telephone VARCHAR(15)

);

Add a comment
Know the answer?
Add Answer to:
You will need to refer to the University database to answer this question. Write SQL queries...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The goal is to write several SQL queries that will answer questions over the database used...

    The goal is to write several SQL queries that will answer questions over the database used by the imaginary Sierra Peak Climbing Club (SPCC), an organization whose members climb the mountain peaks of California’s Sierra Nevada mountain range. The database maintained by the SPCC has four tables: PEAK (NAME, ELEV, DIFF, MAP, REGION) CLIMBER (NAME, SEX) PARTICIPATED (TRIP_ID, NAME) CLIMBED (TRIP_ID, PEAK, WHEN_CLIMBED) The database tables have the following semantics: • PEAK gives information about the mountain peaks that the...

  • Given the following relational schema, write queries in SQL to answer the English questions. There is...

    Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...

  • The goal is to write several SQL queries that will answer questions over the database used...

    The goal is to write several SQL queries that will answer questions over the database used by the imaginary Sierra Peak Climbing Club (SPCC), an organization whose members climb the mountain peaks of California’s Sierra Nevada mountain range. The database maintained by the SPCC has four tables: PEAK (NAME, ELEV, DIFF, MAP, REGION) CLIMBER (NAME, SEX) PARTICIPATED (TRIP_ID, NAME) CLIMBED (TRIP_ID, PEAK, WHEN_CLIMBED) The database tables have the following semantics: • PEAK gives information about the mountain peaks that the...

  • Given the following relational schema, write queries in SQL to answer the English questions. There is...

    Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...

  • Write the SQL queries that accomplish the tasks in Q1-Q7 using the AP Database The manager...

    Write the SQL queries that accomplish the tasks in Q1-Q7 using the AP Database The manager wants to know the names and the full address of the vendors whose name begins with the letter A, B, C, E, or H. Write a SELECT statement that returns VendorName, and the full address. The full address column contains data from VendorCity, VendorState, and VendorZipcode columns. Format full address as follows: City, State Zipcode (for example, “Anaheim,CA 92807”). Sort the results by vendorname,...

  • Given the following relational schema, write queries in SQL to answer the English questions. There is...

    Given the following relational schema, write queries in SQL to answer the English questions. There is a shipment database on the MySQL server. You can also use the DDL for MySQL. You must only submit the SQL for your answers but you can include the query output as well to help the TA with marking. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid: integer, shipdate: Date/Time) ShippedProduct(sid:...

  • Please help me to solve Please, No handwriting COURSE; introduction to database Q- write a query ...

    Please help me to solve Please, No handwriting COURSE; introduction to database Q- write a query SQL by Using the info below A. Normalize the Tables (in 3NF at least) B. Create the Normalized Tables and Populate them with at least 5 Rows C. Write the Wholesale Management System requested Queries & Execute them VERY IMPORTANT Screenshots from MySQL (or any other software you use) of all the tables after queries result. - Database system for a Wholesale Management System...

  • This is third time im posting this Question COURSE; introduction to database Please, No handwriti...

    This is third time im posting this Question COURSE; introduction to database Please, No handwriting thanks for your efforts Design the database by following . Execute the sample requested queries. . ER Diagram. . All schemas before and after normalization. . All SQL statements of: -Creating tables. - Inserting data in tables. -Queries. 5. Screenshots from MySQL (or any other software you use) Question is - Database system for a Wholesale Management System Consider a database system for a Wholesale...

  • This is third time im posting this Question COURSE; introduction to database Please, No handwriting thanks...

    This is third time im posting this Question COURSE; introduction to database Please, No handwriting thanks for your efforts Design the database by following . Execute the sample requested queries. . ER Diagram. . All schemas before and after normalization. . All SQL statements of: -Creating tables. - Inserting data in tables. -Queries. 5. Screenshots from MySQL (or any other software you use) Question is - Database system for a Wholesale Management System Consider a database system for a Wholesale...

  • Write SQL queries to answer the following question: A. Which students are enrolled in Database and...

    Write SQL queries to answer the following question: A. Which students are enrolled in Database and Networking? (Hint: use SectionNo for each class, so that you can determine the answer from the Registration table by itself.) I have attempted the code below, but am receiving an error under the first SELECT, showing error code 1064, (syntax error) SELECT StudentName, StudentID FROM Student WHERE StudentID =(select StudentID FROM Registration WHERE (SectionNo=2714 OR SectionNo=2715) GROUP BY StudentID HAVING COUNT (*)>1;

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT