Fundamentals of Database System (LabQuiz)

Fundamentals of Database System
(PreLabQuiz)
(PreLabExam)
(MidLabQuiz)
(MidLabExam)
(FinLabActivity)
(FinLabQuiz)



Question text

Given the following data definition, select all city names in descending order:

TABLE cities

id INTEGER NOT NULL PRIMARY KEY 

name VARCHAR(30) NOT NULL


Question text


Write an SQL query to find the employee id whose salary lies in the range of 9000 and 15000.

Question text



Write an SQL query to fetch all the employees who either live in California or work under a manager with ManagerId – 321.

Question text


Write an SQL query to fetch the employees whose name begins with any two characters, followed by a text “hn” and ending with any sequence of characters.

Question text


Fetch all the employees who are not working on any project.

Question text

salesman_id |             name    |                city   |              commission

-------------+------------+----------+------------

        5001 |           James Hoog |       New York |                0.15

        5002 |               Nail Knite |            Paris    |                0.13

        5005 |                 Pit Alex   |        London   |                0.11

        5006 |               Mc Lyon    |           Paris    |                0.14

        5007 |             Paul Adam  |        Rome     |                0.13

        5003 |            Lauson Hen |        San Jose |                0.12 

You need to create a table for a salesmen table, which statement creates the table above?


Question text

salesman_id |           name    |                  city   |          commission

-------------+------------+----------+------------

        5001 |       James Hoog |            New York |              0.15

        5002 |           Nail Knite |                 Paris    |              0.13

        5005 |            Pit Alex   |              London   |              0.11

        5006 |         Mc Lyon    |                  Paris    |              0.14

        5007 |       Paul Adam  |                Rome     |             0.13

        5003 |      Lauson Hen |                San Jose |             0.12

Which SQL statement below  displays all the information of all salesmen?


Question text

Which SQL statement will display the names and city of the salesman, who belongs to the city of Paris?

Question text

YEAR                    SUBJECT  CATEGORY                       WINNER                                             COUNTRY                               

---- ------------------------- --------------------------------------------- ------------------------- ------------

1970                       Physics Scientist                              Hannes Alfven                                      Sweden                 

1970                      Physics Scientist                                 Louis Neel                                           France                 

1970                      Chemistry Scientist                          Luis Federico Leloir                               France                 

1970                      Physiology Scientist                         Ulf von Euler                                         Sweden                 

1970                      Physiology Scientist                         Bernard Katz                                        Germany                

1970                      Literature Linguist                       Aleksandr Solzhenitsyn                             Russia                 

1970                      Economics Economist                      Paul Samuelson                                     USA                    

1970                       Physiology Scientist                        Julius Axelrod                                        USA                    

1971                       Physics Scientist                              Dennis Gabor                                     Hungary                

1971                       Chemistry Scientist                         Gerhard Herzberg                              Germany                

1971                       Peace  Chancellor                            Willy Brandt                                       Germany                

1971                       Literature Linguist                            Pablo Neruda                                     Chile                  

1971                       Economics Economist                      Simon Kuznets                                   Russia                 

1978                       Peace President                                Anwar al-Sadat                                  Egypt            

Using the nobel_win table above, give the name of the 'Physics Scientist' winner since 1970. 

Which of the following SQL statement produced the desired result?      


Question text

Using the nobel_win table above, you need to write all the details of the Chemistry winner(year,subjectcategory, winner, country) from the year 1970. 

Which of the SQL statement would produce the required result?  

Question text

Using the above nobel_win table, you need to generate a report that will show all the Physiology winners in the year 1970.

Question text

Using the salesmen table above, you need to generate a report that shows the name and commission from the table salesmen. 

Which SQL statement would produce the required result?

Question text

You need to generate a report that will show all the salesmen's commissions with less than or equal to 15%. 

Which SQL statement produced the desired result?

Question text

Which SQL statement displays the city of the salesmen that starts with the letter P?

Question text

Which SQL statement will display the name of the winner from Physiology Scientist?

Question text

It is the process of producing a set of tables with proper attributes

Question text

Based on the given table above, what is the primary key for the user table?

Question text

Using the table below, what is the UNF of the following table?



Question text

CompanyTable( companyid, company, company_address)

What is the primary key?

Question text

UserTable(userid, name)

Using the above table, what is the primary key of the table named UserTable?

Question text

In the given relationship, the doctor attends to the patient. What is the relationship between doctor and patients?


Question text

Entity CUSTOMER can be characterized by Id, Name, and Address. What is  sub-attributes  of the customer address?

Question text

An Engineer builds a house with few workers and raw materials participating in this building at the same time. What are the entities involved in this relation?

Question textGiven the following relationship, the patient was assigned to a room. What is the relationship between patient and room

Question text

An Engineer builds a house with few workers. Based on the given statement, what is the relationship between engineer and a few workers?