SQL Test 5 - Copy (2)
SQL Test 5 - Copy (2)
Theory Questions
1. What is the difference between SQL and MySQL?
Ans-
SQL (Structured Query Language) is a standard language used
for managing and manipulating relational databases. It is used to
query, update, insert, and delete data, as well as to define and
manage database schemas. SQL is a language that can be used
with any relational database system (e.g., MySQL, PostgreSQL,
Oracle).
MySQL is a specific relational database management system
(RDBMS) that uses SQL as its query language. It is open-source,
widely used for web applications, and supports various features
such as data storage, retrieval, and transaction management.
Key Difference:
SQL is a query language.
MySQL is an RDBMS that implements SQL.
Practical Questions
1. Write a SQL query to retrieve the top 5 highest-paid
employees from the "Employees" table.
Ans-
SELECT *
FROM Employees
ORDER BY Salary DESC
LIMIT 5;
SQL Test for Freshers
Aptitude Questions
1. If a database has 4 tables and each table has an average of
25 records, what is the total number of records across all
tables?
Ans-
If a database has 4 tables and each table has an average of 25 records,
what is the total number of records across all tables?
Total records = 4 tables × 25 records per table = 100 records.