Ques. To Design a Database and create required tables. For e.g. Bank, College Database.
Database : 'Data' is originated from the word 'datum' that means 'single piece of information.' It is plural of the word datum.A database is an organized collection of inter-related data, generally stored and accessed electronically from a computer system.
DBMS : DBMS or Database Management System is a software application used to access, create, and manage databases by modifying them.
Functions of DBMS :
- Data abstraction and independence.
- Data security.
- A locking mechanism for concurrent access.
- Robust data integrity capabilities.
- Logging and auditing of activity.
- Simple access using a standard API.
- Uniform administration procedures for data.
Types of DBMS :
- Hierarchical DBMS : In a Hierarchical database, model data is organized in a tree-like structure. Data is represented using a parent-child relationship. In Hierarchical DBMS parent may have many children, but children have only one parent.
- Network Model : The network database model allows each child to have multiple parents. It helps you to address the need to model more complex relationships like as the orders/parts many-to-many relationship. In this model, entities are organized in a graph which can be accessed through several paths.
- Relational model : Relational DBMS is the most widely used DBMS model . This model is based on normalizing data in the rows and columns of the tables. Relational model stored in fixed structures and manipulated using SQL.
- Object-Oriented Model : In Object-oriented Model data stored in the form of objects. The structure which is called classes which display data within it. It defines a database as a collection of objects which stores both data members values and operations.
Installation steps for MySql:
Installing MySQL on Windows: Your downloaded MySQL is neatly packaged with an installer. Download the installer package, unzip it anywhere and run setup.exe. By default, this process will install everything under C:\mysql.
Verify MySQL installation:
- Step- 1 : Open from start
- Step-2 : enter the password you have set during installation .
- Step-3 : if you already have created data bases then use them else create new database.
Creation of Database :
Syntax : CREATE DATABASE databasename;
How to use the data base you have created :
How to create a table :
CREATE TABLE table_name ( column1 datatype , column2 datatype , column3 datatype, ....);
Creating table college :
|create table college(stu_id int(10),stu_name varchar(30), stu_dept varchar(20),phonenumber int(10),DOB date,address varchar(50),fathers_name varchar(25),mothers_name varchar(25)); |
Creating table bank :
|create table college(stu_id int(10),stu_name varchar(30), stu_dept varchar(20),phonenumber int(10),DOB date,address varchar(50))); |
DESC Command : desc or describe command shows the structure of table which include name of the column, data-type of column and the nullability which means, that column can contain null values or not.
DESCRIBE tablename; OR DESC tablename;
For more Rajasthan Technical University CSE-IV Sem DBMS Lab Experiments CLICK HERE