Articles by "SQL"
Showing posts with label SQL. Show all posts
no image
This Blog is particularly related to different programming subjects. It helps students of MCA, BCA, B.Tech, M.Tech, M.Sc(IT), PGDCA.
Write a query to create a table Employee with the following columns: 

emp_id int, f_name varchar2(20), l_name varchar2(20), title varchar2(30),age int, yos int, salary int, perks int, email varchar2(60).

CREATE TABLE employee_data
(
emp_id int 
f_name varchar2(20),
l_name varchar2(20),
title varchar2(30),
age int,
yos int,
salary int,
perks int,
email varchar2(60)
);

On the basis of above table execute the following command:

1. Write a query to describe a table structure.
DESCRIBE employee_data;

2. Write queries to insert 5 rows of data into the table Employee.
INSERT INTO employee_data (f_name, l_name, title, age, yos, salary, perks, email) 
values ("Manish", "Sharma", "CEO", 28, 4, 20000, 5000, "mansh@bignet.com");

3. Write a query to rename a table.
RENAME age TO Age;

4. Write a query to truncate a table.
Truncate table employee_data;

5. Write a query to drop a table.
Drop table employee_data;


Thanks
Mukesh Rajput
no image
This Blog is particularly related to different programming subjects. It helps students of MCA, BCA, B.Tech, M.Tech, M.Sc(IT), PGDCA.
SQL can be divided into four different parts: 

1. Data Manipulation Language ( DML):
It is used to retrieve, store, modify, delete, insert and update data in the database. Examples: SELECT, UPDATE, INSERT statements

2. Data Definition Language ( DDL):
It is used to create and modify the structure of database objects in the database. Examples: CREATE, ALTER, DROP statements

3. Data Control Language ( DCL):
It is used to create roles, permissions, and referential integrity as well it is used to control access to the database by securing it. Examples: GRANT, REVOKE statements

4. Transactional Control Language ( TCL).
It is used to manage different transactions occurring within a database. Examples: COMMIT, ROLLBACK statements


no image
This Blog is particularly related to different programming subjects. It helps students of MCA, BCA, B.Tech, M.Tech, M.Sc(IT), PGDCA.
Introduction to SQL: SQL is a standard language for accessing and manipulating databases.

What is SQL?
1. SQL stands for Structured Query Language
2. SQL lets you access and manipulate databases
3. SQL is an ANSI (American National Standards Institute) standard.

What Can SQL do?
1. SQL can execute queries against a database
2. SQL can retrieve data from a database
3. SQL can insert records into a database
4. SQL can update records in a database
5. SQL can delete records from a database
6. SQL can create new databases
7. SQL can create new tables in a database
8. SQL can create stored procedures in a database
9. SQL can create views in a database
10. SQL can set permissions on tables, procedures, and views.
SQL is a Standard - BUT...
Although SQL is an ANSI (American National Standards Institute) standard, there are many different versions of the SQL language. However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.

Using SQL in Your Web Site:
To build a website that shows some data from a database, you will need the following:
1. An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
2. A server-side scripting language, like PHP or ASP
3. SQL
4. HTML / CSS

RDBMS: RDBMS stands for Relational Database Management System:

RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. The data in RDBMS is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows. SQL is not case sensitive.