Connect Me

twitterfacebookgoogle plus email

  Instagram View Biwas Bhattarai's profile on LinkedIn

SLC-QBASIC & DBMS

Frequently asked question in School Leaving Certificate(SLC) & Send-Up examination:



WATCH video tutorials in my Youtube Channel. CLICK HERE

To store Code number, Name, grade, section, address, phone number of ‘n’ number of students in a data file “ INFO.TXT”.
CLS
OPEN "INFO.TXT" FOR APPEND AS #1
INPUT "How many records do you want to enter"; H
FOR I=1 TO H
INPUT "Code Number, Name"; CN, N$
INPUT "Grade, section"; G, S$
INPUT "Address, Phone Number";A$, PN$
WRITE #1, CN, N$, G, S$, A$, PN$
NEXT I
CLOSE #1
END

To display all the records from “INFO.TXT” where the name of the students begin with letter “A”
CLS
OPEN "INFO.TXT" FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1,  CN, N$, G, S$, A$, PN$
L$=LEFT$(N$,1)
IF UCASE$(L$)="A" THEN
PRINT  CN, N$, G, S$, A$, PN$
END IF
WEND
CLOSE #1
END

To display all the records from “INFO.TXT” where the address of students is “Jhapa"
CLS
OPEN "INFO.TXT" FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1,  CN, N$, G, S$, A$, PN$

IF UCASE$(A$)="JHAPA" THEN
PRINT  CN, N$, G, S$, A$, PN$
END IF
WEND
CLOSE #1
END


#WAP to display all the contents of data file "student.dat" where fields are unknown.

CLS

OPEN "STUDENT.DAT" FOR INPUT AS #1

WHILE NOT EOF(1)

INPUT #1, RN, N$, GR, S$

PRINT RN, N$, GR, S$

WEND

CLOSE #1

END

Want to print the output in readable format, then just add a line of code.....

CLS

OPEN "STUDENT.DAT" FOR INPUT AS #1

Print "Roll No","Full Name","Grade","Section"

WHILE NOT EOF(1)

INPUT #1, RN, N$, GR, S$

PRINT RN, N$, GR, S$

WEND

CLOSE #1

END

................ try it out




DATABASE MANAGEMENT SYSTEM

1. Fill in the blanks:
a)DBMS can thus be defined as a collection of programs that enables you to store, modify, and extract information from a database.
b) A relational database is a special type of database where data is stored in a number of separate but linked tables.
c) The table design view window allows you to create tables on your own in order to have complete control over the field names, data types and field properties.
d) The caption field property used when you want to display an alternate name for the field to explain the field name.
Ą
https://www.flickr.com/photos/spklg/15211044551/