UNIT III
Chapter-13 EXTENSIBLE MARKUP LANGUAGE
Level-I
1. Markup Language is a set of rules /tag that define the structure and format of text while Presenting text.
2. XML stands for eXtensible Markup Language. Which allows creating application specific structured document by allowing creation of new tags.
3. XML is used to describe what data actually means.
4. A meta-language is a language that’s used to define other language.XML is a meta language.
Level-II
1. (i) ADML (Architecture Description Markup Language)
(ii) GML (Geography markup Language
(iii) MathMl(Mathematical Markup Language)
2.
HTML
|
XML
| |
1
|
HTML document formats and displays web page’s data
|
XML documents carry data along with their description.
|
2
|
HTML tags are predefined
|
New tags can be created as per our requirements.
|
3
|
HTML may not have closing tags.
|
XML must have closing tags.
|
4
|
HTML tags are not case sensitive
|
XML tags are case sensitive.
|
5
|
HTML documents are directly viewable in a browser.
|
XML documents are viewed only if proper style sheet file is also available along with XML file.
|
3.
a. XML is designed to carry data not to display data.
b. XML was created to structure, store and to send information.
c. XML is self descriptive .Tags are not pre defined; rather they are created to describe the content in appropriate manner.
d. XML is free and extensible.
e. XML is platform independent.
f. XML can separate Data from HTML.XML stores and describes data, which can later be formatted and presented in desired way.
g. XML can be used to create new languages, since it is a meta language.
h. XML is supported and recommended by World Wide Web Consortium (W3C).
4. XML Validator And XML parser
Level-III
1.
<?xml version=”1.0”>
<message data=”9/10/2009 >
<sender>gurpreet</sender>
<receivers>
<receiver> Rehana </receiver>
<receiver> Josheph </receiver>
</receivers>
<text>project successfully completed
</text>
</message>
2. The above XML document is not well formed. The document suffer from two errors:
Improper nesting –The body element was opened inside the to element, yet body was not closed before the to element was closed.
Mismatched cases of start and end tags-The tag<sender> is closed with </Sender>, which is incorrect. XML is case sensitive, thus the end-tag of <sender> should be </sender> and not <Sender>
My SQL Revision tour
Level 1:
1. A Primary Key is a set of one or more attribute that can uniquely identify tuples within the relation.
2. A non key attribute, whose values are derived from the primary key of some other table, is known as foreign key in its current table.
3. Referential integrity is a system of rules that a DBMS uses to ensure that relationships between records in related tables are valid, and that users don't accidently delete or change related data.
4. No of tuples in a relation is known as degree and no of attributes in a relation is known as cardinality.
5. The columns in relation is known as attribute and the rows in a relation is known as tuple.
6. A virtual table derived from one of more underlying base tables.
7. A candidate key which is not primary key is known as alternate key.
8. The attribute combination in a relation that can serve as a primary key.
Level 2:
1. . key features are:
a.fast speed.
b.Ease of use.
c.Free of cost.
d.Portability.
e.Security
e.Security
f.Provides many datatypes.
2. The difference between CHAR and VARCHAR is that of fixed length and variable length.The Char datatype specifies a fixed length character string. when a clolumn is given datatype CHAR(n), then the lenght is fixed to n characters and if the value is less than n than blank is added, but the size remain n byte, where as VARCHAR, on the other hand, specifies a variable length string.
3. DDL stands for Data Definition Language, that allows you to perform tasks related to data definition.
DML Stands for Data Manipulation Language, and are used to manipulate data.
4. My SQL is a free, open source Relational Database Management that uses structured query language. In a My SQL database, information is stored in tables.
5. select ename,empno from emp;
6. select ename,empno from emp;
7. select ename,sal,deptno from empl where comm is NULL;
8. select * from emp where sal*12 between 25000 and 40000;
9. select * from empl where comm>sal;
10. select ename from emp where ename like'_ _ A%';
LEVEL 3:
1. Answers are as following:
a. create table club
(
Member_No number(5) Primary key,
Member_Name varchar(40) not null,
Address varchar(30),
Age number(2) check(age>=18),
Type varchar(10),
Fees number(6,2));
b. insert into club
values(101,‘reena’,’hissar’,24,’permanenet’,2000);
insert into club
values(102,‘meena’,’hissar’,24,’permanenet’,2000);
c. select * from club
where type= ‘permanent’ and fees>5000
d. alter table club
add(phno integer);
e. Update club
Set fees=fees*.10
Where type= ‘temp’;
f. Select * from emp
Where age>=18;
2. Answers are as follows:
i. Select * from teachers where department=’HISTORY’
ii. SELECT name from teachers where department=’HINDI’ and sex=’F’
iii. Select name from teacher order by dateofjoin
iv. Select * from teacher where salary between 20000 and 35000
v. Select name, age, department from teachers order by department
vi. Select avg(salary) from teacher group by department
vii. Select avg(salary) from teacher group by department
viii. Select department, sum(salary) from teacher group by department having sum(salary)>50000
ix. Select avg(sal), sex from teachers group by sex
x. Desc teachers.
3. The degree is 7 because the no of attributes are 7 and cardinality is 8
4. Now the degree will become 8 and cardinality will be 11.
5. Answers are as follows:
a. Select * from SchoolBus where capacity > noofstuents
b. Select Area_covered from SchoolBus where distance>20 and Charges<8000
c. Select sum(Noofstudens), Transporter from SchoolBus group by Transporter
d. Insert into SchoolBus values(11, ‘Moti bagh’,35,32,10,’ kisan tours ‘, 35000)
e. Run the query and check
6. Answers are as follows
a. Select name from graduate where div=’I’ order by name;
b. Select NAME, STIPEND, SUBJECT , 12*stipend from graduate;
c. Select count(*) from graduate where subject=’physics’ or subject=’comp. sc’;
d. Insert into graduate
Values(11,’KAJOL’, 300, ‘computer sc’, 75, 1);
e. Run the query and check
7. Answers are as follows:
a. Create table furniture
(
Itemno int(5) primary key,
Itemname varchar(20) not null,
Type varchar(20) reference item(type),
Dateofstock date default=’10-03-10’,
Price int(6) check(price<40000),
Discount int(2) not null);
b. In delete command the name of the columns must not be given in the command.
Database Transaction
Level 2
- Transaction : A transaction is a logical unit of work that must succeed or fail in its entirety. A transaction might be a sequence of many SQL statements, but logically performing a single task, thus all the SQL statements should work as a whole or none at all ensuring the consistency of the database. A transaction is an atomic operation which may not divided into smaller operations.
- ACID properties : A database system must maintain the following four (Atomicity, Consistency, Isolation, & Durability) properties of a transaction:
a) Atomicity : (All or None) This property ensures that either all operations of the transaction are executed or none at all.
b) Consistency: This property implies that if the database is in consistent state before the execution of the transaction, database must remain in consistent state after the execution of the transaction.
c) Isolation: This property suggests that if a transaction is being executed in the database system, no other transaction should be executed at the same time. It simply refers that if a transaction is accessing/modifying some data item, that data item must not be available to other transaction at the same time, since it may be in an inconsistent state.
d) Durability : This property of transaction ensures that after the successful compeletion of the transaction the changes made by it to the database persist, even if there are system failures.
- Commit: This command permanently commits all the changes made in the database after last commit command was executed. After committing the transaction, changes made can not be rolled back.
RollBack : This command rolls back (undoes) all the changes made in the database after last
commit command was executed.
SavePoint : In between the transaction savepoints can be defined. If in any case rollback is needed
but only a few operations are needed to be rolled back, savepoints are useful. Using the
ROLLBACK TO command changes can be undone in reverse direction(last change to first change)
upto specified SAVEPOINT.
- DDL Statement.
- Rollback undoes the previous changes and Commit does the changes permanently.
UNIT-III
Chapter-14 MYSQL REVISION TOUR
Level-I
1. (i) 29, 33
(ii) kv pinjore
2. Reduce redundancy, Control inconsistency, Provide security and protection.
3. Drop table means delete the entire table and drop database means delete the database with all its
tables.
4. A non key attribute of the relation that is foreign key of the other table and primary key for first table
5. It is multithreaded Open source RDBMS.
6. Single row function individual result for each row where as aggregate function gives aggregated
result for the given group of rows.
7. To perform any aggregate operation in groups, we use GROUP BY clause with the Select statement
8. According to table
(i) Select * from teachers where department=’HISTORY’;
(ii) SELECT name from teachers where department=’HINDI’ and sex=’F’
(iii) Select name from teacher order by dateofjoin
(iv) Select * from teacher where salary between 20000 and 35000
(v) Select name, age, department from teachers order by department
(vi) Select avg(salary) from teachers
(vii) Select avg(salary) from teacher group by department
(viii) Select department, sum(salary) from teacher group by department having sum(salary)>50000
(ix) Select avg(sal), sex from teachers group by sex
(x) Desc teachers
Level-II
§ It maintains the integrity of the Database. It does not allow any data to be deleted accidentally.
§ A primary key is used to uniquely identify each row in a table.
NOT NULL constraint ensures that a column cannot have NULL value.
Example:
CREATE TABLE STUDENT
(ROLLNO INT PRIMARY KEY,
FNAME VARCHAR(20) NOT NULL,
LNAME VARCHAR(20) );
Or
CREATE TABLE STUDENT
(ROLLNO INT,
FNAME VARCHAR(20) NOT NULL,
LNAME VARCHAR(20)
PRIMARY KEY (ROLLNO) );
§ DDL commands:- These are data definition language that are use to create table, views, indexes schemas. E. g. create, alter, drop
DML Commands:- Thaese are data definition language that are used for update, insert and delete the data from table. E. g. insert, update, delete
§ Char :- A fixed-length string between and 255 characters in length right-padded with spaces to the specified length when stored values must be enclosed in single quotes or double quotes.
Varchar:- A variable-length string between 1 and 255 characters in length; for example
VARCHAR(25).Values must be enclosed in single quotes or double quotes.
More on SQL
Level 1
- Rules that are defined when a table is created. They help in preventing certain type of inconsistent values from being placed in the column(s).
Constraints name
|
Description
|
PRIMARY KEY
|
Used to create a primary key
|
UNIQUE
|
to create a unique key
|
NOT NULL
|
to define that column will not accept null values.
|
FOREIGN KEY/ REFERENCES
|
to define referential integrity with another table.
|
DEFAULT
|
to define the columns default value.
|
CHECK
|
to define the custom rule.
|
- A Primary key constraint uniquely identifies each row in a table which means that no two rows in a table can have same values. No, only one primary key constraint can be created for each table.
- Foreign key enforces referential integrity. A foreign key column is one whose values are derived from primary key column of another table. Yes, a table can have multiple foreign keys.
- A NOT NULL constraint enforces that the column will not accept NULL values.
- Unique and NOT NULL
- Create table table-name(column-name data-type(size) primary key….);
- It limits the values that can be inserted into a table eg. The age entered by user must be greater than 18
- When a user does not enter a value for the column (having default value), automatically the defined default value is inserted in the field
- Drop table table-name;
Answers
Level 2
1. Alter table
2. Select * from book where price IS NULL;
3. Roll Number
4. Column constraints apply to individual columns whereas table constraints apply to group of one or more columns
5. A composite primary key is made up from combination of columns and it can be defined as only a table integrity constraint.
6. It states that if a DELETE or UPDATE operation affects a row from parent table, then automatic delete or update is made in matching rows of child table.
7. a) Alter table <tablename> ADD [column] <columnname> <datatype>;
b) Alter table <tablename> modify [column] <columnname> <column definition>;
c) Alter table <tablename> drop [column] <columnname>;
8. Yes, with alter command. Alter table <tablename> add primary key(columnname);
9. Yes. Alter table <tablename> drop primary key;
10. Show create table <tablename>;
11. MySQL does not require that NOT NULL be defined for each column belonging to primary key. MySQL will define the column as NOT NULL itself.
12. Create table address(city varchar(20), state char(2), pin int primary key);
13. Foreign keys are defined to force a DBMS to check that no incorrect data can be entered in the tables.
Answers
Level 3
- SET NULL
- C)
- Line 5, because NOT NULL constraint is not defined at table level.
- We can’t disable primary key but can be dropped if required with Alter command
- To disable: SET FOREIGN_KEY_CHECKS=0;
To enable: SET FOREIGN_KEY_CHECKS=1;
- Alter table a1 drop foreign key f1;
- a) Domain Integrity
b) Referential Integrity
- c) REFERENCES
- A PRIMARY KEY or UNIQUE KEY must exit on parent table
- When the referenced and referencing tables associated with a foreign key are the same, such a table is called self-referencing table.
UNIT -4
IT APPLICATION
Answers of Level 1 Questions
Ans. 1 A “front-end” application is one that application users interact with directly. For example, Internet Browser or any other software application where an end user works.
Ans. 2 A “back-end” application or program serves indirectly in support of the front-end services, usually by being closer to the required resource or having the capability to communicate with the required resource. For example databases like MySQL, Oracle, OOo Base , MS -Access etc.
Ans. 3 E-Governance is the use of a range of modern information and communication technologies such as internet , local area network, mobiles etc. by government to improve effectiveness of their services.
Ans.4 E-Learning is a delivery of learning, training or education program by electronic means
Ans.5 E-business is a term used to described business run on the computer
Ans.6 If Data Validation is not done then prog. May work on wrong data, therefore data validation2 is important.
Ans.7 Front End : Java Back End : My SQL
Ans.8 B2B, B2C, C2C C2B, B2B
Ans.9 User interface is the junction between a user and a computer Program. It sets command or menus through user communicate with a program.
Ans10 Textbox, text area, button, Label, checkbox, radio button, combo box, list box etc.
Answers of Level 2 Questions
Ans. 1
- Improves Government processes
- Increases the efficiency and speed in a transparent manner.
- Simplify administrative transactions.
- Citizen can participate in decision making process
Ans.2
i. Improved quality of information and information supply.
ii. Reduction of process time.
iii. Cost reduction
iv. Improved service level
v. Increased efficiency.
Ans.3 There are various social be benefits of e-governance
a. openness and transparency
b. Enhanced policy effectiveness
c. Increased democratic participation etc
d. Increased economic competitiveness.
Ans.4 It reduced overall cost, learning time reduced, increased retention and application to job.
Ans.5.
i. It enables students to complete training conveniently at off-hours or form home.
i. Self pacing for slow and quick learners reduces stress and increased satisfaction.
ii. Interactivity engage users, pushing them rather than pulling them through training etc.
Ans.6 Textbox, text area, button, Label, checkbox, radio button, combo box, list box etc.
Ans.7 User interface is a junction between user and a computer. it has various advantages
a It provides ways to communicate
b. It provide meaningful feedback when error occur and provide context sensitive user help facility.
c. It provides appropriate interaction facilities for different types of system user.
Ans. 8 E-learning is preferred because it provides faster learning at reduced cost, increased accessed to learning and clear accountability for all participants in the learning process.
Ans. 9.
i. Use of web to find prices and reviews
i. Use of our website for managing the information in our business.
ii. Fast communication with customer, members or suppliers via email etc.
b. Use of website for research and to find recent trends.
Ans. 10 There are two main issues while designing front end interfaces these are
a. How can information from the user are provided to the computer system?
b. How can information from the computer system be presented to the user?
The various ways of data entry are as fallows.
i. Direct Manipulation
ii. Menu Selection
iii. Form Fill in.
iv. Command Language
v. Natural Language.
Answers of Level 3 Questions
Ans.1. Front-end means which you are going to have look and feel like jsp, swings, awt package, Backend means which is going to implement business logic for you.
Ans.2. Front-end testing is basically GUI testing or GUI functional testing. Backend testing involves databases or any backend storage. It’s basically testing data while travelling from front to back end or in back end to back end only. For example, if you enter some data in front end application and it is getting stored on some database then you have to test it whether it is storing correctly you can do it by writing sql queries / scripts.Also if application is not front end (GUI) for example, you are creating some table using joining 40 different input/source tables then you have to test it. In this case you have write queries to validate source and target data between those table using sql scripts.
Ans.3. It reduced overall cost, learning time reduced, increased retention and application to job.
Ans4. 1. A lot of productive time of government servants and general public is saved.
2. Transparency has increased and therefore cheating cases have been reduced.
Ans.5 It reduced overall cost, learning time reduced, increased retention and application to job.
.Ans.6 Yes , In many ways
a. Cost effective
b. Time saving
c. Transparency
d. Simplicity in work etc
Ans.7 Java interface MYSQL through JDBC.
Ans.8 E-Learning offers many things as compared to normal learning like use of technology, learning on demand, participation of all etc.
Ans.9 • Goods sold through e-business are generally cheaper as cost incurred in ebusiness
is less compared to setting up a traditional business.
• Customers can receive highly customizable service.
• Even Remote area customers are reached in e-business.
• Sellers have better understanding of their customers' needs as customers communicate through e-mails.
Ans.10 Textbox, option button, combo box, radio button, Label and refer case study for GUI Development Steps
No comments:
Post a Comment