What is SQL?. SQL stands for Structured Query Language. It is a tool(Programming language) to access and manipulate databases. SQL perform following tasks: execute queries against a database retrieve data from a database insert , update, delete records in a database create new databases, new tables in a database create stored procedures, views in a database set permissions on tables, procedures, and views.
What is Data?. Data is a collection of a distinct small unit of information. It can be used in a variety of forms like text, numbers, media, bytes, etc. it can be stored in pieces of paper or electronic memory, etc. Examples: weights, prices, costs, numbers of items sold, employee names, product names, addresses, tax codes, marks etc..
Different forms of data:. Information is data that has been converted into a more useful or intelligible form..
What is a Database?. A database is an organized collection of data. It is used for easily accessing, storing, retrieving and managing the data . It is made up of a collection of tables that stores a specific set of structured data. The main purpose of the database is to operate a large amount of information by storing, retrieving, and managing data. Example: MySQL , Sybase, Oracle, MongoDB , PostgreSQL , SQL Server, etc ..
What is DBMS?. DBMS stands for Database Management System. It is a program that controls creation, maintenance and use of a database. DBMS is a system software responsible for the creating, retrieving, updating and managing the database. It ensures that our data is consistent, organized and is easily accessible by end user. DBMS can be termed as File Manager that manages data in a database rather than saving it in file systems..
What is RDBMS?. RDBMS stands for Relational Database Management System. RDBMS stores data in the form of a collection of tables and relations can be defined between the common fields of these tables. Example : Microsoft SQL Server, MySQL, Oracle , etc. A table is a collection of related data entries and it consists of columns and rows. RDBMS is an advanced version of a DBMS. RDBMS allows to access data more efficiently then DBMS..
Difference between DBMS and RDBMS?. Object-Oriented Programming is the solution to resolve the functional programming problems. OOPs provide some principles and using these principles we can resolve the functional programming problems very easily. The principles are: Abstraction, Encapsulation, Inheritance, Polymorphism..
What are the components of RDBMS?. Relational Database consists following components : Table, Record, Field, Domain, Keys. Table : is a collection of rows and columns. Record : A single row in a table is called a record . Field : A field is a column or attribute of a table. Domain: A domain is a set of permitted values for a column or attribute in table. Ex: EmployeeID accept only integer value. Key : Key is a column or set of columns in a table, which is uniquely identified. Ex: Primary Key, Foreign Key, Unique Key etc..
Explain DML, DDL, DCL, and TCL statements?. DML stands for Data Manipulation Language. It is used to retrieve, insert, update, and delete data in a database. DDL stands for Data Definition Language. DDL statements are used to alter/modify a database or table structure and schema . DCL stands for data control language. Generally, we will use these commands to secure database objects. TCL stands for Transactional Control Language. TCL is used to manage transactions within a database..
What are the actions performed by DML , DDL, DCL, and TCL statements?.
What is the difference between where clause and having clause ?.
What are the differences between primary key and unique key?.
How can we copy the data from one table to another?.
What are the different ways to create a new table from an existing table?.
What is N ormalization ?. Normalization is a database design technique that reduces data redundancy and eliminates nonrealistic characteristics like Insertion, Update and Deletion Anomalies. Normalization rules divides larger tables into smaller tables and links them using relationships. The purpose of Normalization is to eliminate redundant (repetitive) data and ensure data integrity..
What are the different normalization forms?. 1NF (First Normal Form): Each table column should contain a single value. Each record must be unique . 2NF (Second Normal Form): It is in first normal form all non-key attributes are fully functional dependent on the primary key. 3NF (Third Normal Form): it is in second normal form there is no transitive dependency for non-prime attributes..
What is De-normalization?. De-normalization is the process or technique to optimize the performance of a database by adding redundant data. De-normalization is a technique to move from higher to lower normal forms of database to speed up database access . Some times we have applied multiple joins to receive desired output. But implementing lots of join can degrade our database performance. This is the right place to use de-normalization..
What is Data Integrity?. Data integrity means the data contained in the database is accurate and reliable. To provide data integrity, RDBMS provides a set of integrity constraints that ensures that data entered into the database is accurate, valid, and consistent. The different levels of data integrity are: 1.Entity Integrity (uniquely identify- PK, UQ) 2.Domain Integrity (Follow defined rule- Check) 3.Referential integrity (relationships- FK) 4.User-defined integrity.
What is a Constraint in SQL Server?. A constraint is a property that is assigned to a column or set of columns in a table that is used to enforce data integrity means it ensures that the data is going to store in a table is valid, consistent, and accurate . Characteristics of Constraint: 1.A constraint is used to restrict the insertion of unwanted data in any columns. 2.We can create constraints on single or multiple columns of any table. 3.It maintains the data integrity i.e. accurate data or original data of the table..
What are the different types of Constraints?. SQL Server supports five constraints for maintaining data integrity which are: 1.UNIQUE KEY constraint 2.NOT NULL constraint 3.CHECK KEY constraint 4.PRIMARY KEY constraint 5.FOREIGN KEY constraint. Note: Constraints are applied on columns of a table..
What is the difference between a primary key and a unique key?.
Difference between primary key and foreign key?. Primary key: A primary key uniquely identifies a record in the table. Primary Key can’t accept null values and duplicate values. By default, primary key is a clustered index and data in the database table is physically organized in the sequence of the clustered index. We can have only one Primary key in a table. Foreign key: A foreign key is a field in the table that is the primary key (or unique key) in another table. The foreign key can accept null values and duplicate values. A foreign key does not automatically create an index, clustered, or non-clustered. We can manually create an index on the foreign key. We can have more than one foreign key in a table..
What is an index?. 1.An index is a database object which is used by the SQL server to speed up the performance of queries by providing query access to rows in the data table. 2.By using indexes, we can save time and we can improve the performance of database queries and applications. 3.When we create an index on any column SQL Server internally maintains a separate table called index table so that when any user trying to retrieve the data from the existing table depends on index table SQL Server directly go to the table and retrieve required data very quickly. 4.In a table, we can use a maximum of 250 indexes. The index type refers to the way the index is stored internally by SQL Server..
What is a Clustered Index in SQL Server?. 1. A clustered index determines the physical order of data in a table. For this reason, a table can have only one clustered index . 2. A table can have only one clustered index in it which will be created when the primary key constraint used in a table. 3. If a table has no clustered index its data rows are stored in an unordered structure ..
Difference between clustered and non-clustered index?.
Basic differences between Stored Procedure and Function in SQL Server.
Advance Differences between Stored Procedure and Function in SQL Server.