You are here:   HomeStructured Query (SQL)
by Dinesh Thakur Category: SQL Queries

Use the LIKE condition to perform wildcard searches of valid search string values. Search conditions can contain either literal characters or numbers. You can combine pattern-matching characters. You can use the ESCAPE identifier to search for the actual % and _ symbols.

 
by Dinesh Thakur Category: SQL Queries

The PRIMARY KEY constraint uniquely identifies each record in a database table. Primary keys must contain unique values. A primary key column cannot contain NULL values. Each table should have a primary key, and each table can have only one primary key.



 
by Dinesh Thakur Category: SQL Queries

The EXISTS condition is considered "to be met" if the subquery returns at least one row. EXISTS operator simply tests whether the inner query returns any row. If it does, then the outer query proceeds. If not, the outer query does not execute, and the entire SQL statement returns nothing.

 
by Dinesh Thakur Category: SQL Queries

Check constraint is used to validate values entered into a column. CHECK constraints enforce domain integrity by limiting the values that are accepted by a column. They are similar to FOREIGN KEY constraints in that they control the values that are placed in a column. The difference is in how they determine which values are valid: FOREIGN KEY constraints get the list of valid values from another table.

 
by Dinesh Thakur Category: SQL Queries

A UNIQUE key integrity constraint requires that every value in a column or set of columns (key) be unique-that is, no two rows of a table have duplicate values in a specified column or set of columns.

 
by Dinesh Thakur Category: SQL Queries

By default all columns in a table can contain null values. If you want to ensure that a column must always have a value, i.e. it should not be left blank, then define a NOT NULL constraint on it.

 
by Dinesh Thakur Category: SQL Queries

The HAVING Clause was added to SQL because the WHERE keyword could not be used with aggregate functions. As we know that WHERE clause is used to restrict the number of rows fetched from the table. But if we try to restrict the number of groups with where clause it will generate an error message. So we can use having clause to divide the groups with Group by clause.

 
by Dinesh Thakur Category: SQL Queries

In SQL the UNION Clause combines the results of two SQL queries into a single table of all matching rows. The two queries must have the same number of columns and compatible data types to unite. Any duplicate records are automatically removed unless UNION ALL is used.



 
by Dinesh Thakur Category: SQL Queries

Sometimes we may decide that we need to get rid of a table in the database for some reason. The SQL DROP TABLE statement is the SQL command that removes an entire SQL table. This command also removes one or more table definitions and all data, indexes, triggers, constraints, and permission specifications for those tables.



 
by Dinesh Thakur Category: SQL Queries

You can rename a table or a column temporarily by giving another name known as alias. The term alias means an alternate name. Here’s an example of how to use a column alias

 

Page 3 of 6



Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular





Search Content







Advance Courses



Basic Courses



Advertise with Us