Question

In: Computer Science

Write the following SQL queries and show the corresponding output of the DBMS: 1) Write an...

Write the following SQL queries and show the corresponding output of the DBMS:

1) Write an SQL statement to display all the information of all Nobel Laureate winners.
2) Write an SQL statement to display the string "Hello, World!".
3) Write an SQL query to display the result of the following expression: 2 * 14 +76.
4) Write an SQL statement to display the winner and category of all Laureate winners.
5) Write an SQL query to find the winner(s) of the 1987 prize for Chemistry.
6) Write an SQL query to find the subject and category for which 'Paul Samuelson' won his Nobel Prize.
7) Write an SQL query to give the name of the 'Linguist' winners before year 2000.
8) Write an SQL query to show all the details of the Economics and Literature Subject prize winners between the years 1971 to 1990 inclusive.
9) Write an SQL query to show all the details of the winners with the letters sequence 'er' in their names.
10) Write an SQL query to show all the winners in Physics for 1970 together with the winner of Economics for 1971.
11) Write a SQL query to show all the winners of Nobel Prize in the year 1970 for all subjects except Physiology and Economics.

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

This demonstration is using MySQL.

Question 1:

SQL Query :

SELECT * FROM `nobellaureatewinners`;

Screen in MySQL :

********************************

Question 2:

SQL Query :

select 'Hello, World!';

Screen in MySQL :

********************************

Question 3:

SQL Query :

select 2 * 14 +76;

Screen in MySQL :

********************************

Question 4:

SQL Query :

SELECT Winner,Category FROM nobellaureatewinners;

Screen in MySQL :

********************************

Question 5:

SQL Query :

SELECT Winner FROM nobellaureatewinners
where year=1987 and Subject='Chemistry';

Screen in MySQL :

********************************

Question 6:

SQL Query :

SELECT subject,Category FROM nobellaureatewinners
where Winner='Paul Samuelson';

Screen in MySQL :

********************************

Question 7:

SQL Query :

SELECT Winner FROM nobellaureatewinners
where Category='Linguist' and year <2000;

Screen in MySQL :

********************************

Question 8:

SQL Query :

SELECT * FROM nobellaureatewinners
where Subject in ('Economics','Literature')
and year BETWEEN 1971 and 1990;

Screen in MySQL :

********************************

Question 9:

SQL Query :

SELECT * FROM nobellaureatewinners where Winner like '%er%';

Screen in MySQL :

********************************

Question 10:

SQL Query :

SELECT Winner FROM nobellaureatewinners where
(Subject='Physics' and Year=1970) or
(Subject='Economics' and Year=1971);

Screen in MySQL :

********************************

Question 11:

SQL Query :

SELECT Winner FROM nobellaureatewinners
where year=1970 and Subject not in ('Physiology','Economics')

Screen in MySQL :

********************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

Using your downloaded DBMS (MS SQL Server or MySQL), write SQL queries that inserts at least...
Using your downloaded DBMS (MS SQL Server or MySQL), write SQL queries that inserts at least three rows in each table. For the On-Demand Streaming System, First, insert information for multiple users, at least three video items and insert the three different types of subscriptions (Basic, Advanced, Unlimited) into the database. Then insert at least three user subscriptions. Execute the queries and make sure they run correctly
a) Write down the SQL Statement for the below Queries b) Supply sample tale output c)...
a) Write down the SQL Statement for the below Queries b) Supply sample tale output c) the database Used is the University Schema downloaded at lecture 1. Write a query to display the name for those Students who gets more Tot_Cred than the Student whose ID is 55739. 2. Write a query to display the name salary, department name, instructor id for those instructors who works in the same department as the instructor works whose id is 83821. 3. Write...
Question 1: Part 1 Write SQL statements for the following queries from the ‘EMPLOYEE’ table in...
Question 1: Part 1 Write SQL statements for the following queries from the ‘EMPLOYEE’ table in the WPC Database in MySQL: Display all records from the Employee table for employees working in the “Marketing” department. Display all records from the Employee table for employees working in the “Marketing” department OR “Finance” Department. Display the Last Names of all employees such that each last name appears only once. Display all the attributes for employees whose employee number is less than 10....
In this assignment, you are required to write the SQL statements to answer the following queries...
In this assignment, you are required to write the SQL statements to answer the following queries using PostgreSQL system. The SQL statements comprising the DDL for Henry Books Database are given to you in two files. For that database, answer the following queries. Create the files Q1 to Q10 in PostgreSQL. Do follow the restrictions stated for individual queries. 1. List the title of each book published by Penguin USA. You are allowed to use only 1 table in any...
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a...
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a select statement to show the invoicelineitemdescriptions that have the total invoicelineitemamount >1000 and the number of accountno is >2. 10. Write a select statement that returns the vendorid, paymentsum of each vendor, and the number of invoices of each vendor, where paymentsum is the sum of the paymentotal column. Return only the top ten vendors who have been paid the most and the number...
Write SQL queries below for each of the following: List the names and cities of all...
Write SQL queries below for each of the following: List the names and cities of all customers List the different states the vendors come from (unique values only, no duplicates) Find the number of customers in California List product names and category descriptions for all products supplied by vendor Proformance List names of all employees who have sold to customer Rachel Patterson
Write the following questions as queries in SQL. Use only the operators discussed in class (no...
Write the following questions as queries in SQL. Use only the operators discussed in class (no outer joins) Consider the following database schema: INGREDIENT(ingredient-id,name,price-ounce) RECIPE(recipe-id,name,country,time) USES(rid,iid,quantity) where INGREDIENT lists ingredient information (id, name, and the price per ounce); RECIPE lists recipe information (id, name, country of origin, and time it takes to cook it); and USES tells us which ingredients (and how much of each) a recipe uses. The primary key of each table is underlined; rid is a foreign...
Write SQL queries for the following statements based on Employees table whose schema is given below:...
Write SQL queries for the following statements based on Employees table whose schema is given below: (Employee_ID,First_Name,Last_Name,Email,Phone_Number,Hire_Date,Job_ID,Salary, Manager_Id, Department_Id) a. Create the given table along with the following constraints: Phone_Number should not be left undefined, salary should be between 10000 and 20000, employee_id should uniquely identify rows and should not be left undefined. User-defined names should be given to constraints. b.  Display each employee’s last name, hire date and salary review date (which is the date after six months of service)....
I am having a hard time writing these SQL queries. Please specify the following queries in...
I am having a hard time writing these SQL queries. Please specify the following queries in SQL on the database schema shown in the figure below. STUDENT Name StudentNumber Class Major Smith 17 1 CS Brown 8 2 CS Kathy 15 1 EE COURSE CourseName CourseNumber CreditHours Department Intro to Computer Science CSE110 4 CS Data Structures CSE205 4 CS Discrete Mathematics MAT240 3 MATH Databases CSE380 3 CS Analog Circuits EE260 3 EE SECTION SectionIdentifier CourseNumber Semester Year Instructor...
Using the below two SQL queries and comments below, provide explanation on why the output count...
Using the below two SQL queries and comments below, provide explanation on why the output count varies and which SQL yield correct result. (20 points) Both SQLs are joining two tables Both SQLs are syntactically correct Query #1 returns about 19614 rows versus Query #2 returns 3550134. Query #1: select * from person.Address addr inner join person.StateProvince prov on addr.StateProvinceID = prov.StateProvinceID Query #2: select * from person.Address addr,person.StateProvince prov
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT