Professional Documents
Culture Documents
Ch. Devilal State Institute of Engineering and Technology, Panniwala Mota (Sirsa)
Ch. Devilal State Institute of Engineering and Technology, Panniwala Mota (Sirsa)
PRACTICAL FILE
DATABASE MANAGEMENT SYSTEM
Submitted by:
Ankit Jaiswal (182003)
CSE 4th sem
Submitted to:
Ms. Seema Yodha
Prof. Of CSE
PROGRAM:-1
Aim:-Use oracle software and login with valid user id and password.
Explore its GUI and practice some basic commands of it.
❖ Steps to install MySQL:-
● If you are connecting to the internet while installing MySQL, you can choose the online
installation version mysql-installer-web-community-<version>.exe .
● In case you want to install MySQL offline, you can download the mysql-installer-
community-<version>.exe file.
Step 2 – Welcome Screen: A welcome screen provides several options. Choose the first
option: Install MySQL Products.
Step 3 – Download the latest MySQL products: MySQL installer checks and downloads the
latest MySQL products including MySQL server, MySQL Workbench, etc.
Step 9 – MySQL Server Configuration: choose Config Type and MySQL port (3006 by
default) and click Next button to continue.
Step 9.1: MySQL Server Configuration: choose Windows service details including Windows
Service Name and account type, then click Next button to continue.
Step 10: Configuration Overview: MySQL Installer installs sample databases and sample
models.
Installation Completed: The installation completes. Click the Finish button to close the
installation wizard and launch the MySQL Workbench.
PROGRAM:-2
AIM:- WAP to create a table having different fields and
datatypes.
CREATE DATABASE
A Database is defined as a structured set of data. So, in SQL the very first step to store the
data in a well-structured manner is to create a database. The CREATE DATABASE
statement is used to create a new database in SQL.
Syntax:
Example Query:
This query will create a new database in SQL and name the database as sin;
CREATE TABLE
We have learned above about creating databases. Now to store the data we need a table to do
that. The CREATE TABLE statement is used to create a table in SQL. We know that a table
comprises of rows and columns. So while creating tables we have to provide all the
information to SQL about the names of the columns, type of data to be stored in columns,
size of the data etc. Let us now dive into details on how to use CREATE TABLE statement to
create tables in SQL.
Syntax:
Example Query:
PROGRAM: 3
AIM:-WAP to create a table with different types of constraints.
CONSTRAINTS:-
Constraints can be specified when the table is created with the CREATE TABLE statement,
or after the table is created with the ALTER TABLE statement.
Syntax
CREATETABLEtable_name (
column1 datatypeconstraint,
column2 datatypeconstraint,
column3 datatypeconstraint,
....
);
SQL Constraints
● SQL constraints are used to specify rules for the data in a table.
● Constraints are used to limit the type of data that can go into a table. This ensures the
accuracy and reliability of the data in the table. If there is any violation between the
constraint and the data action, the action is aborted.
● Constraints can be column level or table level. Column level constraints apply to a
column, and table level constraints apply to the whole table.
The following constraints are commonly used in SQL:
The CHECK constraint is used to limit the value range that can be placed in a column.
If you define a CHECK constraint on a single column it allows only certain values for this
column.
If you define a CHECK constraint on a table it can limit the values in certain columns based
on values in other columns in the row.