0% found this document useful (0 votes)
25 views

10th Class DATABASE Notes

Uploaded by

gsssshahzadpur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

10th Class DATABASE Notes

Uploaded by

gsssshahzadpur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SESSION 1: Appreciate the Concept of Database Management System Primary key

What is Database Management System? It ensures each record is unique in a table.
It is also indexed in database, making it faster to search for records
 It is application software that can be used to create and manage database efficiently.  A table can have only primary key
 it enable user or application to create, store, update, delete and retrieve data from  Primary key cannot have NULL values
database itself. Composite Primary Key
 Examples of DBMS are MySQL, Oracle, MongoDB, MS Access, MS SQL Server,
FoxPro, SQLite etc.
When Primary key constraint is applied on or more columns then it is known as Composite
What is database?
primary key.

Database is an organized collection of interrelated data that has been recorded, organized and
Foreign Key
made available for searching is called Database.
 The field which is Primary key in another related table.
Advantages of Database  Foreign key is used to establish relation between two tables.
 A table can have more than Foreign key
Reduced Data Redundancy: As different type of data are stored in different tables within a What is RDBMS?
single database, chances of repetition of data reduced to zero.
RDBMS stands for Relational Database Management System. It was developed by E.F. Codd at
Data Integrity: Data integrity ensures that data stored in database is valid, accurate and IBM 1970. It is used to organize collection of data as a relation where relation corresponds to a
consistent in database. There are many data constraints present in database that implements data table of values. Often, data in a relational database is organized into tables.
integrity.
SESSION 2: Create and Edit Table using Wizard & SQL Commands
Data Consistency: it refers to same appearance of data across the database and for all the users
viewing the database. Moreover, any changes made to data are instantly reflected to all its Database Objects
associated tables within a database and there is no data inconsistency.
Tables:
Data Privacy: there are data security rules that when applied can ensure the accessibility scope
of data at different levels to authentic users only.  A table is a set of data elements (values) that is organized using a model of vertical
columns (which are identified by their name) and horizontal rows.
Backup and Recovery: there is provision of automatic data backup that helps to restore  A table has a defined number of columns, but can have any number of rows.
database in case of system failure or crash and keep data safe and available.  Each row is identified by the values appearing in a particular column identified as a
unique key index or the key field
Features of Database Columns or Fields or Attributes

 A database can have more than one table.  A column is a set of data values of a particular type, one for each row of the table.
 Each table in a database contains information about one type of item.  The columns provide the structure according to which the rows are composed.
 Every record must be unique in a table.  For example, Itemcode, Itemname are fields in a row
 Every table should have one or more fields designated as key. Rows or Records or Tuples
 Sequence of Columns (fields) of table can be in any order
Keys in Database A row also called a Record or Tuple represents a single, data item in a table.
Creating database in Open Office 5. After entering all fieldname, select a field name and right click at left most side
6. Select ‘Primary Key’ from pop up
1. Start Open Office 7. After specifying all, save the table by clicking File → Save
2. Select the option Database 8. Specify table name and click OK
3. In database Wizard dialog, select ‘Create a new database’ and click Next and then click Data Types
on Finish (with no change)
4. In Save As dialog, specify name for the database and click save Data types are used to determine which type of data we are going to store in the database.
5. Database Window will be opened
What is Table? Following tables shows different data types used in Open Office Base

Tables are the basic building blocks of a database which is used to store data in the database.

How many ways we can create table in Open Office Base?

We can create table in two ways

 Create table using Wizard


 Create table in Design View
Create Table using Table Wizard

1. Open your database


2. Click Tables → select Use Wizard to create table
3. From the dialog, click select Fields → Choose Category → Select the table from ‘Sample
Tables’ drop down
4. Select the fields as per your choice and select arrow button —– to add predefined
columns
5. Click on Next
6. Now select the filed form ‘selected field’ list and set its data type by selecting it from Table Data View dialog box
‘Field Type’ drop down
7. Repeat step 6 for other fields
We can enter records in a table using table data view.
8. Click Next
9. Check ‘create Primary key’
10. Click on ‘Use an existing field as primary key and then select field name from from down SESSION 3: Perform Operations on Table
11. Click Next
Inserting, Editing and deleting data in the table
12. Click Finish (make sure ‘Insert data immediately’ is selected )
13. Now datasheet window appears where you can enter records or close it.
Create table using Design View 1. Select the table → double click on it
2. Now table datasheet widow opens, here you can enter records, modify it or delete it.
Field Properties
1. Open your database
2. Click Tables → select ‘Create Table in Design View’
 Auto Value: it set to yes, field will get the auto numeric values
3. In table design window, type field name in ‘field name’ column and select its data type
from ‘Field Type’ data type  Length – By default length of the field is 10 but the size of the field can be set to
4. Repeat step 3 for entering other fields maximum length.
 Default Value – A default value can be set for a field if user don’t provide any value How to remove relationship between tables
while entering the values in the table.
 Format example – This property helps to set the format of the data entered in the field The relationships applied on the tables can be removed also with the help of Delete option.
such as 91-222-333. Right Click on the relationship thread and select Delete option
 Entry required – if set to yes then it will be must to insert the value in the field which
means that field cannot be left blank. SESSION 4: Retrieving data using Query
Referential Integrity
What is query?
Referential integrity is used to maintain accuracy and consistency of data in a relationship.
Query is an object in Open Office base which is used to search specific records from one
Referential integrity helps to avoid: or more table.
 Query helps use to join records from different tables and filter that information

 Adding records to a related table if there is no associated record available in the primary How many ways we can create query in Open Office Base?
key table.
 Changing values in a primary if any dependent records are present in associated table(s). We can create query in 3 ways in Open Office Base as given below:
 Deleting records from a primary key table if there are any matching related records
available in associated table(s). 1. Create query using Wizard
Relationships between Tables 2. Create query in design view
3. Create query using SQL
A relationship refers to an association or connection between two or more tables. When you Create query using Wizard
relate two tables, you don’t need to enter the same data in separate tables.
1. Open your database
Relationships between tables help to: 2. Select query → create ‘Create Query using Wizard’
3. Select table from ‘tables’ drop down
 Save time as there is no need to enter the same data in separate tables. 4. Add fields from ‘Available fields’ list by clicking ‘>’ to ‘Fields in the Query’ list
 Reduce data-entry errors. 5. Click on finish
 Summarize data from related tables. Create Query using Design View
Types of relationships
1. Open your database
 ONE to ONE: In this relationship, both the tables must have primary key columns. 2. Select Query → create query in design view
 ONE to MANY or MANY to ONE: In this relationship, one of the table must have 3. Select the table from show table box and add it in query
primary key column 4. Now double click all the fields you want to display in query result
 MANY to MANY: In this relationship, no table has the primary key column 5. Set the condition at ‘criteria’ row for the field to be searched
Creating Relationship between tables 6. Save and run query
What is SQL?
1. Open your database
2. Select Relationship option from Tools Menu SQL is Structured Query language (pronounced as ‘sequel’) is computer language used to create
3. Select the table and click on add button to Add the tables in amongst which you want to manage database. We can create queries SQL to view or retrieve specific records from database.
create relationship
4. Close show table box SELECT statement
5. Now place the mouse over the common field which is primary in a table
6. Hold down the mouse button and drag it over same common field of another field SELECT statement in SQL is used to retrieve records from one or more tables of a database. It
7. Release the mouse button. You will see a line appears between linked tables now. is one of the most commonly used DML (data manipulation Language) command.
How to use Select statement to retrieve data from table Display items which rate is less than 100rs

To view all fields: SELECT * FROM item WHERE rate <100;

SELECT * FROM <table name>; Display name, department and salary of all employees after incrementing salary by 1000.

To view specific fields: SELECT ename, dept, salary + 1000 FROM employee;

SELECT <field(s)> FROM <table name>; Display records of those salesman who lives in Delhi and Mumbai from salesman table.

WHERE clause SELECT * FROM salesman WHERE city IN (‘Delhi’, Mumbai’)

We can use WHERE clause with SELECT statement to create query. WHERE clause is used to Display students details from student table in ascending order of rollno.
set criteria for the data to be retrieved from table.
SELECT * FROM student ORDER BY rollno;
Syntax:
Display all item details of patanjali brand which rate is 100.
SELECT <field name(s)> FROM <table name>
SELECT * FROM item WHERE brand = ‘patanjali’ AND rate = 100;
WHERE <criteria>;
UPDATE statement
ORDER by clause
Update statement is used for modifying records in a database.
It is used to arrange or sort data in ascending or descending order in resultset. It can be used
with SELECT statement as given below: The general syntax of the update statement is as follows:

SELECT <field(s)> FROM <tablename> UPDATE <table name>


WHERE <criteria>
ORDER BY <field name> ASC/DESC; SET = expression
Create Query using SQL
WHERE <criteria>;
1. Open your database
2. Select Query → Create Query in SQL view
For example
3. Now SQL editor opens, here you can type SQL Query using SELECT Command
4. Save and Run Query
Examples of SQL Query Update SDetails set Location = ‘Bhubaneswar’ where Rollno = 14;

Display iname and its price from item table. Will update location to Bhubneshwar of student havng rollno 14.

SELECT iname, price FROM item; SESSION 5: Creating Forms and Reports Using Wizard

What is Form in Open Office Base?


A form provides the user a systematic way of storing information into the database.
It is an interface in a user specified layout that lets users to view, enter, and change data
directly in database objects such as tables
CREATING Form using Wizard

1. Open your database


2. Select Form →Create form using Wizard
3. Select table or query name from ‘table or query’ drop down list
4. Add fields from ‘available fields’ to ‘fields in the query’ by clicking ‘>’. (To use all
fields at once click ‘ >>’)
5. Click Next
6. Click Next again
7. Select a Controls Arrangement layout for your Form and click Next
8. Select the data entry model (mostly we use ‘the form is to be used for entering new data
entry’)
9. Click Next and Select a Style for your form
10. Click Next and set the name of the form
11. Click Finish
What is Report in Open Office Base?

A report is an object of Open Office Base used for generating printout of records in
organized manner.
 Report can group and generate summary of available data in clear format.
CREATING Form using Wizard

1. Open your database


2. Select Report →Create report using Wizard
3. Select table or query name from ‘table or query’ drop down list
4. Add fields from ‘available fields’ to ‘fields in the query’ by clicking ‘>’. (To use all
fields at once click ‘ >>’)
5. Click Next
6. Click Next again
7. If you want to group records than select the field from ‘fields’ list based on which data
will be grouped, otherwise click Next directly
8. If you want to sort the data in report than select field name from ‘sort by’ drop down’ list
and than click Next
9. Select the look of report from ‘layout of data’ list
10. Select an option from ‘layout of header and footer’ as per your requirement
11. Select ‘orientation’ if required
12. Click Next and give title of the report
13. Click ‘Finish’

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy