Structured Query Language
Structured Query Language
Structured Query Language
1. Right Join
2. Outer Join
3. Full Join
4. Cross Join
5. Self Join.
WHERE <Condition>
Q#11. Is it possible for a table to have more than one foreign key?
Ans. Yes, a table can have many foreign keys and only one primary key.
Q#12. What are the possible values for BOOLEAN data field.
Ans. For a BOOLEAN data field two values are possible: -1(true) and 0(false).
Example:
SELECT * FROM table_name SAMPLE(10);
Q#19. Write a SQL SELECT query that only returns each name only once
from a table?
Ans. To get the each name only once, we need to use the DISTINCT keyword.
DDL stands for Data Definition Language. CREATE ,ALTER, DROP, RENAME are DDL
statements.
Q#23. Suppose a Student column has two columns, Name and Marks. How to
get name and marks of top three students.
Ans. SELECT Name, Marks FROM Student s1 where 3 <= (SELECT COUNT(*) FROM
Students s2 WHERE s1.marks = s2.marks)
1. Atomicity
2. Consistency
3. Isolation
4. Durability.
UNION ALL – returns all rows selected by either query, including all duplicates.
Primary key cannot contain Null values whereas Unique key can contain Null values.
1. Views restrict access to the data because the view can display selective columns from the
table.
2. Views can be used to make simple queries to retrieve the results of complicated queries.
For example, views can be used to query information from multiple tables without the
user knowing.
Q#43. List the various privileges that a user can grant to another user?
Ans. SELECT, CONNECT, RESOURCES.
TRUNCATE removes ALL rows from a table by de-allocating the memory pages. The operation
cannot be rolled back
Constraint Check
Validation of a Field size
Stored procedure
Matching application field size to database
Indexes for performance based issues
Natural Join
Inner Join
Outer Join
Cross Join
B-Tree index
Bitmap index
Clustered index
Covering index
Non-unique index
Unique index
6) While testing stored procedures what are the steps does a tester
takes?
The tester will check the standard format of the stored procedures and also it checks the fields are
correct like updates, joins, indexes, deletions as mentioned in the stored procedure.
8) In data base testing, what are the steps to test data loading?
Following steps need to follow to test data loading
Source data should be known
Target data should be known
Compatibility of source and target should be checked
In SQL Enterprise manager, run the DTS package after opening the corresponding DTS package
You have to compare the columns of target and data source
Number of rows of target and source should be checked
After updating data in the source, check whether the changes appears in the target or not.
Check NULLs and junk characters
12) To manage and manipulate the test table what are the SQL
statements that you have used in Database testing?
The statements like SELECT, INSERT, UPDATE, DELETE are used to manipulate the table, while
ALTER TABLE, CREATE TABLE and DELETE TABLE are used to manage table.
13) How to test database procedures and triggers?
To test database procedures and triggers, input and output parameters must be known. EXEC
statement can be used to run the procedure and examine the behaviour of the tables.
Network Model
Hierarchical Model
Relational Model
The white box testing is done to check the accuracy of code and logic of the program. This testing is
done by the programmer who knows the logical flow of the system.
23) What RDBMS stands for and what are the important RDMBS
that SQL use?
RDBMS stands for Relational Database Management Systems that use SQL, and the important
RDBMS that SQL uses are Sybase, Oracle, Access ,Ingres, Microsoft SQL server etc.
Q. What is a join?
Join is a process of retrieve pieces of data from different sets (tables) and returns them
to the user or program as one “joined” collection of data.
Q. What is Normalization?
A. The process of table design is called normalization.
Q. What is Trigger?
A. Trigger will execute a block of procedural code against the database when a table
event occurs. A2. A trigger defines a set of actions that are performed in response to an
insert, update, or delete operation on a specified table. When such an SQL operation is
executed, in this case the trigger has been activated.
Q. Write a SQL SELECT query that only returns each city only
once from Students table? Do you need to order this list with an
ORDER BY clause?
A. SELECT DISTINCT City FROM Students;
Q. Write SQL SELECT query that returns the first and last name
of each instructor, the Salary, and gives each of them a number.
A. SELECT FirstName, LastName, Salary, ROWNUM FROM Instructors;