0% found this document useful (0 votes)
45 views5 pages

Textbook Exercise-G7 - M5

Uploaded by

apurbobaida3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views5 pages

Textbook Exercise-G7 - M5

Uploaded by

apurbobaida3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Answers of textbook exercises

Fill in the Blanks

1. DML stands for D ata Manipulation Langu


a g e.
2. You can add a new row to a table using the i n s e r t command.
3. The operator used for multiple character wildcards is %.
4. The SQL keyword l i k e is used with wildcards.
5. SQL commands that modify database data are called D M L.

State True or False

1. WHERE clause cannot be used with DELETE statement.-False


2. SQL uses FROM clause to name the source table in a select
query.-True
3. DISTINCT keyword eliminates duplicate records.-True
4. In SQL % (Percentage) is used as a single character wildcard.-False
5. CREATE is a DML statement.-False

Match the Following

1. Insert Values
2. Wildcard Pattern matching
3. Update Set

4. Read Select
5. \ Escape character
Multiple choice questions

1. What is the use of WHERE clause in SQL?


a. Filter the columns that are returned.
b. Filter the rows that are returned.
c. Select the last column.
d. Select all rows.

2. Which of the following SQL Statement(s) is correct?


a. SELECT username AND password FROM tb1_login.
b. SELECT username, password WHERE user
username="Cybersquare"
c. SELECT username, password FROM tb1_login.
d. All of the above.

3. The wildcard in a WHERE clause is used when?


a. Exact match is necessary in a SELECT statement.
b. Exact match is not possible in a SELECT statement.
c. Exact match is necessary in a CREATE statement.
d. Exact match is not possible in a CREATE statement.

4. Which of the following is the correct order of keywords for SQL


SELECT statements?
a. FROM, WHERE, SELECT
b. SELECT, FROM, WHERE
c. WHERE, FROM, SELECT
d. SELECT, WHERE, FROM

5. Which of the following is not a DML?


a. Insert
b. Update
c. Delete
d. Truncate

Answer in one word or one sentence

1. How can you remove a record with the name “John” from the
person's table?
DELETE FROM persons WHERE name=’John’;

2. Write down the syntax of the insert statement.


INSERT INTO table_name
(column1,column2,column3,...)
VALUES (value1,value2,value3,...);

3. What is the full form of CRUD?


C - Create
R - Read
U - Update
D - Delete

4. What will happen if you do not use the WHERE condition with
delete statement?
The whole table data will be deleted.

5. What is the use of the ORDER BY keyword?


ORDER BY keyword is used to sort the result-set in
ascending or descending order.
Answer the following

1. What is a CRUD operation?


CRUD operations in SQL refer to the fundamental tasks of Create,
Read, Update, and Delete performed on database records.

2. Write down the syntax of any three DML statements.


★ INSERT INTO table_name
(column1,column2,column3,..)
VALUES(value1,value2,value3,...);
★ SELECT what_to_select FROM table_name WHERE
conditions_to_satisfy;
★ UPDATE table_nameSET column1=value1,
column2=value2,..WHERE condition;

3. Write down the query to create the following table.


Column name Data type Constraint
Id int Primary key
Username Varchar Unique
Password Varchar
Name Varchar
Date of birth Date
Gender Character

CREATE TABLE User (


Id int PRIMARY KEY,
Username varchar(30) UNIQUE,
Password varchar(20),
Name varchar(20),
Date_of_birth date,
Gender char
);
4. Explain DML statements.
DML is used for managing data within schema objects. The
following are the main DML operations.

● INSERT
● SELECT
● UPDATE
● DELETE

5. What are the different clauses in SQL?


The different clauses in SQL are:
● WHERE
● HAVING
● GROUP BY
● ORDER BY

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy