answersLogoWhite

0

📱

Database Programming

Databases are collections of tables that maintain and display information, often collaboratively; this information can be used for interaction with an application or gaining general knowledge. Questions about database engines and modifying or using them belong in this category.

8,803 Questions

What is the definition of a file based approach?

It is a method for storing and organizing computer files and the data they contain to make it easy to find an access.

What is file oriented approach and database oriented approach?

The file is store the data as document type, we don't have give particular data-type of data which will be store in it.

But in database system there are specified structure (like in table format) of data store. First we have to make format with particulate data-type for the data, which will store in it.

other

The file has no record system, while database system store data with record in row, it is easy to maintain.

What is the difference between a data type and a data structure?

Data type can be regarded as data structure because we can define our own data type by using typed function. Data types are the category in which the variable are listed to hold the specific value and data structures are the way in which the values and variables are stored in the memory. The use of a data type called structures allows a collection of values possibly of different types to be treated as a single item. Each data structure is built up from the basic data types of the underlying programming language using the available data structuring facilities, such as

arrays & pointers

What is the difference between a binary tree and a complete binary tree?

Let's start with graphs. A graph is a collection of nodes and edges. If you drew a bunch of dots on paper and drew lines between them arbitrarily, you'd have drawn a graph.

A directed acyclic graph is a graph with some restrictions: all the edges are directed (point from one node to another, but not both ways) and the edges don't form cycles (you can't go around in circles forever).

A tree, in turn, is a directed acyclic graph with the condition that every node is accessible from a single root. This means that every node has a "parent" node and 0 or more "child" nodes, except for the root node which has no parent.

A binary tree is a tree with one more restriction: no node may have more than 2 children.

More specific than binary trees are balanced binary trees, and more specific than that, heaps.

A binary tree can be empty ..whereas the general tree cannot be empty

Explain four major advantages of Object Oriented Programming with the help of an Example?

To explain an object oriented programming with real time examples, try using a packet of sweetener. A packet of sugar has a rectangular shape, made of paper, inked wording and contains something sweet. The same can be said for a packet of Splenda. They both have properties inherited from the abstract packet.

Why is binary data representation and signaling the preferred method of computer?

The short answer is that it's cheaper. Base 2 (binary) is the most primitive form of numeric notation there is and it is extremely simple to implement using a bewildering array of mediums. For example, a switch is either on or off; a capacitor has a sufficient charge or it does not; polarised particles are either positively or negatively charged; a punch card has a hole at a given position or it does not; a DVD either has a flat or a land; a barcode element either reflects light or it absorbs light; and so on.

While it is certainly possible to implement a digital computer using a numeric base other than base 2, the complexity (and the cost!) of interpreting those bases increases exponentially. Polarised digital states (yes/no, true/false, on/off, black/white, positive/negative) are extremely simple to detect and represent because there are only 2 possible states and 1 threshold per digit. More importantly, switching from any one state to any other state is a constant time operation.

Consider the capacitor: it either has sufficient charge or it does not, but it must be refreshed at regular intervals in order to maintain state (if we don't refresh often enough, a full charge will drain away in just a few milliseconds resulting in a misread digit). But if the specific level of charge actually indicated a digit in the range 0 to 9 we'd not only need much larger capacitors to cover the range with comfortable margins of error between refreshes, we'd also need extremely precise transistors to both read and refresh the charge. The more digits we represent per capacitor, the more complex it becomes.

Which of the following types of memory contain data that cannot be modified by the user?

Pick one:

ROM, PROM, EPROM

write-protected magnetic disk/tape, CD-ROM, DVD-R

write-protected partition/file, other user's or sysadmin's file

code-segment, read-only data-segment, other user's or kernel's code- or data-segment

What is data structure?

The data structures are user defined data types specifically created for the manipulation of data in a predefined manner. Examples of data structures would be stacks,queues,trees,graphs and even arrays(also reffered as data structure)

Write a algorithm in c to add two sparse matrices?

#include <stdio.h>

#include <conio.h>

#include <alloc.h>

#define MAX1 3

#define MAX2 3

#define MAXSIZE 9

#define BIGNUM 100

struct sparse

{

int *sp ;

int row ;

int *result ;

} ;

void initsparse ( struct sparse * ) ;

void create_array ( struct sparse * ) ;

int count ( struct sparse ) ;

void display ( struct sparse ) ;

void create_tuple ( struct sparse *, struct sparse ) ;

void display_tuple ( struct sparse ) ;

void addmat ( struct sparse *, struct sparse, struct sparse ) ;

void display_result ( struct sparse ) ;

void delsparse ( struct sparse * ) ;

void main( )

{

struct sparse s[5] ;

int i ;

clrscr( ) ;

for ( i = 0 ; i <= 4 ; i++ )

initsparse ( &s[i] ) ;

create_array ( &s[0] ) ;

create_tuple ( &s[1], s[0] ) ;

display_tuple ( s[1] ) ;

create_array ( &s[2] ) ;

create_tuple ( &s[3], s[2] ) ;

display_tuple ( s[3] ) ;

addmat ( &s[4], s[1], s[3] ) ;

printf ( "\nResult of addition of two matrices: " ) ;

display_result ( s[4] ) ;

for ( i = 0 ; i <= 4 ; i++ )

delsparse ( &s[i] ) ;

getch( ) ;

}

/* initialises structure elements */

void initsparse ( struct sparse *p )

{

p -> sp = NULL ;

p -> result = NULL ;

}

/* dynamically creates the matrix */

void create_array ( struct sparse *p )

{

int n, i ;

/* allocate memory */

p -> sp = ( int * ) malloc ( MAX1 * MAX2 * sizeof ( int ) ) ;

/* add elements to the array */

for ( i = 0 ; i < MAX1 * MAX2 ; i++ )

{

printf ( "Enter element no. %d:", i ) ;

scanf ( "%d", &n ) ;

* ( p -> sp + i ) = n ;

}

}

/* displays the contents of the matrix */

void display ( struct sparse s )

{

int i ;

/* traverses the entire matrix */

for ( i = 0 ; i < MAX1 * MAX2 ; i++ )

{

/* positions the cursor to the new line for every new row */

if ( i % MAX2 0 )

printf ( "\n" ) ;

printf ( "%d\t", * ( s.result + i ) ) ;

}

}

/* deallocates memory */

void delsparse ( struct sparse *p )

{

if ( p -> sp != NULL )

free ( p -> sp ) ;

if ( p -> result != NULL )

free ( p -> result ) ;

}

What is a Data?

Data is everything, the quesiton you asked consisted of data.

data is the entity on which programs written or work. like library systems it is student details, book details on which program works.

What is the difference between a database and word processing?

Authors are far more concerned with the actual content than the layout and will use word processors to produce that content. Desktop publishing is more concerned with layout than with content.

Difference between primary key candidate key and super key?

A primary Key which uniquely identifies a row of table,primary key does not allow null values and also not allow duplicate values.

Superkey is defined in the relational model of database organization as a set of attributes of a relation variable (relvar) for which it holds that in all relations assigned to that variable there are no two distinct tuples (rows) that have the same values for the attributes in this set. Equivalently a superkey can also be defined as a set of attributes of a relvar upon which all attributes of the relvar are functionally dependent. If you more information so you can visit this website:http://www.iyogibusiness.com

What is a downcall?

The term upcall is typically used in the context of using a framework, such as CORBA. When a request is sent from a client application to a server application, the framework is responsible for data marshalling, data transmission, and notification of the recipient that a request has been issued. An upcall is the call into the user code from the framework. This is typically supported through the use of a registered callback function registered either directly by the user, or indirectly through the mechanisms of the framework. An upcall is also called a callback.

Difference between classification and prediction?

The decision tree is a classification model, applied to existing data. If you apply it to new data, for which the class is unknown, you also get a prediction of the class. The assumption is that the new data comes from the similar distribution as the data you used to build your decision tree. In many cases this is a correct assumption and that is why you can use the decision tree for building a predictive model.

Define and give three examples of primitive data types?

A primitive variable can be one of eight types: char, boolean, byte, short, int, long, double, or float. Once a primitive has been declared, its primitive type can never change, although in most cases its value can change. they are used to store values like name, age, salary etc.

Which data type would you assign to an address field?

For mailing address: in some computer languages, strings or text will be the answers. For OO language, a class Address should be designed to be the template to hold onto any address information. (an address is a class with a lot of string fields for address lines, city, zip, state, county, country, province, zone, district, etc)

For internet address: some languages such as C# already provides you with Url class

What are the benefits of using Abstract Data Types?

  • The implementor of the class can change the implementation for maintenance, bug fixes or optimization reasons, without disturbing the client code.
  • The data type is defined as a set of high-level services with a semantic contract defining both the output that is provided and the input that is required from the client. This actually correspond to the general definition of a type in programming: a type is defined as a set of possible values and a set of operations available on these values.

Why should an object hide its data?

As my AP Computer Science teacher eloquently said:

"You can't let strangers touch your private parts"

Therefore, if data was not hidden, a client class can modify all the variables(given that it is not a final constant) by simply calling:

className.variableName = newWrongData;

By using special methods to access the variables, the class can change its internal implementation, without breaking compatibility with other classes that are already using it.

What are some examples of procedural and non procedural programming?

Procedural programming is classic programming where the program language is used to tell the computer EXACTLY what do do - step by step. Examples are Assembler, Fortran, Cobol, C, etc etc. Very detailed, very difficult and time consuming to write, but very efficient from the computers point of view. NON-procedural programming is where you tell the computer what you want, and it figures out how to get it. Non/P programming is often used for database manipulations, like SQL, Visual Basic, etc etc. A SQL command like "Select name, address, city, state, zip order by zip" is non procedural. That one line replaces dozens, or hundred of lines, that would be needed to do the same thing in Cobol or C to get data out of a database.

How do you pronounce queue?

There are many ways to pronounce it. The most common are pronounced like kwark and kwork

Who developed language C?

Dennis M. Ritchie developed the C language from 1969 through 1973 while working at Bell Labs. Although Brian Kernighan is often attributed as co-developer, he was actually co-author of 'The C Programming Language' book which came out in 1978 and served as the informal specification for what became known as "K&R C". Ritchie's original version is now referred to as "Classic C". K&R C was later replaced by ANSI C and is covered by Kernighan and Ritchie's second edition of the same book.