Suppose you have a table of employee details consisting of columns names (employeeId, employeeName), and you want to fetch alternate records from a table. How do you think you can perform this task?

You can fetch alternate tuples by using the row number of the tuple. Let us say if we want to display the employeeId, of even records, then you can use the mod function and simply write the following query: 1 Select employeeId from (Select rownumber, employeeId from employee) where mod(rownumber,2)=0 where ‘employee’ is the table … Read more

What is Normalization? Explain different types of Normalization with advantages.

Normalization is the process of organizing data to avoid duplication and redundancy. There are many successive levels of normalization. These are called normal forms. Each consecutive normal form depends on the previous one. The first three normal forms are usually adequate. First Normal Form (1NF) – No repeating groups within rows Second Normal Form (2NF) … Read more

What do you mean by DBMS? What are its different types?

A Database Management System (DBMS) is a software application that interacts with the user, applications and the database itself to capture and analyze data. The data stored in the database can be modified, retrieved and deleted, and can be of any type like strings, numbers, images etc. There are mainly 4 types of DBMS, which … Read more

What is the default port for SQL?

The default TCP port assigned by the official Internet Number Authority(IANA) for SQL server is 1433. The default port for SQL can vary depending on the specific SQL database management system (DBMS) being used. However, the most common default port for SQL Server is 1433, while for MySQL it is 3306. It’s essential to specify … Read more

What are the differences between the sum function and using “+” operator?

The SUM function returns the sum of non-missing arguments whereas “+” operator returns a missing value if any of the arguments are missing. Consider the following example. Example: data exampledata1; input a b c; cards; 44 4 4 34 3 4 34 3 4 . 1 2 24 . 4 44 4 . 25 3 … Read more