Concept explainers
Display values from table:
The contents from the table can be viewed by using “SELECT” statement which comes under Data Manipulation Language (DML).
The Syntax to view the contents using asterisk (*) is as follows:
SELECT * FROM table_Name;
Selective columns can also be retrieved by replacing all the column(s) names in place of the asterisk symbol.
WHERE Statement:
“WHERE” statement is used limit the number of rows. For example: Consider a table “FTable” that has two columns named “FruitName” and “Color”. “WHERE” clause is used when there is a need to display the entire FruitName whose color is Red.
SELECT * FROM FTable WHERE color = 'red';
When the above statement is executed, red colored fruits get displayed.
IS NULL operator:
“IS NULL” operator is used to get values from the column(s) in which the condition is equal to “NULL”.
Syntax:
SELECT * FROM table_Name WHERE column_Name IS NULL;
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Database Concepts (8th Edition)
- Write SQL queries for the following. Display details of those patients whose age is either 25 or 36 or 29 without using comparison operator. Display first name and last name of those doctors whose salary is less than or equal to 77,000 and greater than or equal to 50,000 using between operator. Display details of those doctors who neither belong to Isb nor Rwp nor Multan without using in and like operator. Display full name of doctors whose first name is other than Tania. Display first name of doctors whose first name contains any of vowels (a,e,i,o,u). Display names of those patients whose name’s second letter is neither ‘a’ nor ‘d’ Display details of those male patients whose age is 25 or 36. Display details of those patients whose name contains less than 5 characters. Display first 4 doctors who are earning least salary. Display details of all patients in such a way that female patients are shown before male patients. Display the unique cities from doctor table. Display all…arrow_forwardWrite SQL queries for the following. Display details of those patients whose age is either 25 or 36 or 29 without using comparison operator. Display first name and last name of those doctors whose salary is less than or equal to 77,000 and greater than or equal to 50,000 using between operator. Display details of those doctors who neither belong to Isb nor Rwp nor Multan without using in and like operator. Display full name of doctors whose first name is other than Tania. Display first name of doctors whose first name contains any of vowels (a,e,i,o,u). Display names of those patients whose name’s second letter is neither ‘a’ nor ‘d’ Display details of those male patients whose age is 25 or 36. Display details of those patients whose name contains less than 5 characters. Display first 4 doctors who are earning least salary. Display details of all patients in such a way that female patients are shown before male patients. Display the unique cities from doctor table. Display all…arrow_forwardwrite an sql query that displays the parking space number location as well as the name of the staff member to whom the parking space has been allocatedarrow_forward
- Show the product names for products that have been ordered in quantities equal to or exceeding 120. Use a non-correlated subquery in the SQL statement.arrow_forwardWrite a SQL query to calculate the total purchase amount of orders that have an even ID numberarrow_forwardWrite an SQL statement to change the value of Std. Poodle in BreedName of PET_3 to Poodle, Stdarrow_forward
- Write an SQL statement to add a CHECK constraint to the PET table so that the weight data recorded in the PetWeight column you added to the table in either question 3.47 or 3.49 is less than 250.arrow_forwardWrite the SQL code that will produce the same information that was shown in Problem 2, but sorted by the employee’s last name. The results of running that query are shown in Figure P7.3.arrow_forwardWrite SQL statements to the following queries. Retrieve the PRODUCT_NAME that product UNIT_PRICE less than the 10 (use subquery).arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr