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 a TOOR?

Toor is a pronunciation which people in Gujarat make for 'tuver'. It is a type of "daal".

What is Remote Data Object?

A remote data object is one that would be located on a different "node". For instance, a node the hardware where the operating system resides, which houses a database. Nodes have IP addresses and names. Say that the main database resided on node "Payroll" (10.128.132.10). Via a database link, an object from another node "Accounting" (10.128.142.11) is referenced. An example of this could be a view which pulls data from a table in the Payroll database and joins it to a table in the Accounting database and the view shows data from both nodes.

Sorting numbers using user-defined functions in C programming?

Assume your numbers are into an array. Then write any user-defined function implementing any kind of sorting. I am giving example of bubble sort.

  1. void bubble(int a[],int n){
  2. int i,j,t;
  3. for(i=n-2;i>=0;i--){
  4. for(j=0;j<=i;j++){
  5. if(a[j]>a[j+1]){
  6. t=a[j];
  7. a[j]=a[j+1];
  8. a[j+1]=t;
  9. }
  10. }
  11. }
  12. }

What is Three tier architecture dbms?

In 3 tier architecture, client directly interacts with intermediate server and intermediate server will directly interact with database server.

Type of data communication?

What is the difference between data communication and telecommunication ?

How do you connect visual basic 6.0 access database using module and data environment?

There are several ways to connect Visual Basic 6.0 access databases, but to use module and data environment equipment, one must obtain access to the actual program to download first.

Advantages and disadvantages of file base approch with respect to database approch?

Data Redundancy

Data Redundancy means same information is duplicated in several files. This makes data redundancy.

Data Inconsistency

Data Inconsistency means different copies of the same data are not matching. That means different versions of same basic data are existing. This occurs as the result of update operations that are not updating the same data stored at different places.

Example: Address Information of a customer is recorded differently in different files.

Difficulty in Accessing Data

It is not easy to retrieve information using a conventional file processing system. Convenient and efficient information retrieval is almost impossible using conventional file processing system.

Data Isolation

Data are scattered in various files, and the files may be in different format, writing new application program to retrieve data is difficult.

Integrity Problems

The data values may need to satisfy some integrity constraints. For example the balance field Value must be grater than 5000. We have to handle this through program code in file processing systems. But in database we can declare the integrity constraints along with definition itself.

Atomicity Problem

It is difficult to ensure atomicity in file processing system.For example transferring $100 from Account A to account B.If a failure occurs during execution there could be situation like $100 is deducted from Account A and not credited in Account B.

Concurrent Access anomalies

If multiple users are updating the same data simultaneously it will result in inconsistent data state. In file processing system it is very difficult to handle this using program code. This results in concurrent access anomalies.

Security Problems

Enforcing Security Constraints in file processing system is very difficult as the application programs are added to the system in an ad-hoc manner.

1 Difference between relational algebra and relation Calculus?

What is the Diff. Between Relational Algebra & Calculas?

{| ! width="33%" | Point of Comparison |- ! width="33%" | R.Algebra ! width="33%" | R.Calculus | Is it Query Language ? YES YES Relation Query Describe step-by-step proceduar for computing the desired answer ,depend on the order in which operator are applies in query Describe the set of answer without being excplicit about how they should be computed Type Proceduar Non-proceduar |}

File Upload into Database in JSP?

<%@page language="java" session="true"

import="java.io.*,java.util.*,java.io.*,java.sql.*,javax.servlet.*"%>

<%

//to get the content type information from JSP Request Header

String contentType = request.getContentType();

if (contentType != null && contentType.indexOf("multipart/form-data") >= 0)

{

DataInputStream in = new DataInputStream(request.getInputStream());

//we are taking the length of Content type data

int formDataLength = request.getContentLength();

byte dataBytes[] = new byte[formDataLength];

int byteRead = 0;

int totalBytesRead = 0;

//this loop converting the uploaded file into byte code

while (totalBytesRead < formDataLength)

{

byteRead = in.read(dataBytes, totalBytesRead, formDataLength);

totalBytesRead += byteRead;

}

String file = new String(dataBytes);

//for saving the file name

String saveFile = file.substring(file.indexOf("filename="") + 10);

saveFile = saveFile.substring(0, saveFile.indexOf("\n"));

saveFile = saveFile.substring(saveFile.lastIndexOf("") + 1,saveFile.indexOf("""));

int lastIndex = contentType.lastIndexOf("=");

String boundary = contentType.substring(lastIndex + 1);

int pos;

//extracting the index of file

pos = file.indexOf("filename="");

pos = file.indexOf("\n", pos) + 1;

pos = file.indexOf("\n", pos) + 1;

pos = file.indexOf("\n", pos) + 1;

int boundaryLocation = file.indexOf(boundary, pos) - 4;

int startPos = file.substring(0, pos).getBytes().length;

int endPos = file.substring(0, boundaryLocation).getBytes().length;

// creating a new file with the same name and writing the content in new file

//FileOutputStream fileOut = new FileOutputStream(saveFile);

FileOutputStream fileOut = new FileOutputStream("C:\\Program Files\\Apache Software Foundation\\Tomcat 5.0\\webapps\\incidentreportform_main\\upload"+saveFile+"");

fileOut.write(dataBytes, startPos, (endPos - startPos));

fileOut.flush();

fileOut.close();

//out.println(saveFile);

Connection con=null,con1=null;

Statement stmt=null,stmt1=null;

PreparedStatement ps=null,ps1=null;

ResultSet rs=null,rs1=null;

String sql="",sql1="",a="";

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con=DriverManager.getConnection("jdbc:odbc:inficert","inficert","inficert");

stmt=con.createStatement();

String sno=request.getParameter("parameter");

int j1=0;

try

{

sql="UPDATE department set crftitle =('"+saveFile+"') where sno='"+sno+"'";

j1=stmt.executeUpdate(sql);

if(j1!=0)

{

%>

<script type="text/javascript">

alert('Successfully Uploaded');

top.location.href = "selectlocation.jsp";

</script>

<%

}

}

catch(Exception ex)

{

ex.printStackTrace();

}

}

%>

What is anH-R diagram?

That's short for Hertzsprung-Russel diagram. It is a diagram in which the total luminosity versus color (and therefore temperature) of many stars is plotted.

Is string is an predefined data types in c?

No. In C string is an array of characters terminated by a null character (a character having ascii value 0).In more high level languages like C# and Java string is a predefined data type and hence limits the operation on string by some pre-defined library functions. But C provides complete control over strings.The Following step shows declaration of a string in various methods.

char str[6] = {'h' . 'e'. 'l'. 'l'. 'o'.'\0'};

One thing you need to notice is that the size of the character array should be atleast 1 greater than the number of characters in the string for accommodating the null character.

but

char str[] = "hello";

statement appends the null character automatically and no need to specify the length of the array (of course you can specify it if you want). The compiler automatically allocates the memory according to the length of the string.

Difference between Sybase and Sybase IQ?

There are two answers to this.

Sybase, or Sybase Incorporated, is a company that makes software products for enterprise systems. The company has two subsidiaries, iAnywhere and Sybase 365, both of which focus on mobility solutions. So when you say "Sybase", you are actually talking about a company.

A lot of people use the term "Sybase" to describe Sybase Adaptive Server Enterprise, or Sybase ASE. This is similar to saying "Oracle", when you mean "Oracle 10g". ASE is the large scale enterprise database, and competes directly with Oracle 10g and IBM DB2. It is a row based storage RDBMS, suitable for On Line Transaction Processing (OLTP) as well as data storage and reporting.

Sybase has three other database products: Sybase IQ, SQL Anywhere, and Advantage. Each is designed for a specific market.

Sybase IQ is an RDBMS which uses a column-based storage system. This means it stores data based the column the data comes from, and not the row the data is associated with.

Column based storage has become a very popular design over the last few years, because it is very efficient at producing reports and can hold a lot of archival data in a much smaller footprint.

Sybase IQ has been around for over 10 years, and is about to hit release 15.0 (sometime in the first half of 2009). This is signifcantly longer than some of it's competitors, who have only just started building column oriented storage systems. For this reason it is very popular for most reporting applications, incuding data warehouses and datamarts.

Sybase IQ uses the same SQL syntax as Sybase ASE, and is fully ANSI SQL compliant. It stores data in tables, the same way as other relational databases. Any application or reporting engine that can run queries against Sybase ASE (or any relational database, for the most part) can use Syabse IQ. The only difference is "under the hood" in the disk storage mechanism.

What are popular database vendors?

Just a few examples: CodeGear sell Interbase; Microsoft sell MS-SQL and Access; Oracle; Progress; mySQL is free.

Where are Linux passwords stored?

On most Linux distributions, LOCAL passwords are stored in one of two places: /etc/passwd, or /etc/shadow. They are simple text files containing user information.

Some systems are configured to authenticate using LDAP or other methods (typically over a network to some type of server) - those will be dependent on the specific setup.

Almost all distributions store passwords encrypted, so you won't be able to edit or see the password, but you can clear the field out and/or reset it if need be.

If you are trying to reset a password, you will need to log in as root and issue the command 'passwd <username>' to change it. If you are trying to log in as root and forgot the password, you will need to start the system in single-user mode and reset it manually - you can Google "Reset Linux Root Password" for instructions, it's a common procedure.

What is the difference between flowchart and decision table?

flowsheets means the flowchats will be written inthe sheets.. flowcharts means the charts flowsheets means the flowchats will be written inthe sheets.. flowcharts means the charts

What ismeant by MAR MDR in computer?

MAR is memory address register. MDR is memory data register. These are registers part of the control unit (CU) in your cpu.

How do you upgrade pixel shader?

Pixel shader technology is hard-coded into the video card and its drivers. If you have a very fast processor and a good amount of ram, you may be able to get around the pixel shader requirement by downloading "3DAnalyze" or "Swiftshader 2.0" to emulate pixel shader.

More likely, the best option is for you to simply replace your video card with one which has native support for pixel shader.

Video cards with pixel shader 3.0 are very common these days, it is not an expensive upgrade & will improve performance on other programs as well.

What different types of clutch systems are there?

clutch is a mechanism for transmitting rotation, which can be engaged and disengaged. Clutches are useful in devices that have two rotating shafts. In these devices, one shaft is typically driven by a motor or pulley, and the other shaft drives another device. In a drill, for instance, one shaft is driven by a motor, and the other drives a drill chuck. The clutch connects the two shafts so that they can either be locked together and spin at the same speed (engaged), or be decoupled and spin at different speeds (disengaged).

types of different clutches are:

  • Dog clutches
  • Cone clutches
  • Torque limiter or Safety clutch: This device allows a rotating shaft to "slip" when higher than normal resistance is encountered on a machine. An example of a safety clutch is the one mounted on the driving shaft of a large grass mower. The clutch will "slip" or "give" if the blades hit a rock, stump, or other immobile object.
  • Overrunning clutch or freewheel
  • Centrifugal clutch and semi-centrifugal clutch
  • Hydraulic clutch
  • Electromagnetic clutch

What is the difference between script and scriptlet?

"script" is an HTML tag used to include JavaScript on a web page.

Example:

<HTML>

<body>

<script type="text/javascript">

document.write("hi there"); // javascript interpreted by the browser

</script>

</body>

</HTML>

"Scriptlet" is a JSP construct used to include Java in a JSP page.

Example:

<HTML>

<body>

<% // this is a scriptlet

response.getWriter().write("hi there"); // Java executed on the server

%>

</body>

</HTML>

Here the result (an HTML document with the text "hi there") is the same in both cases, but the mechanisms are different - Javascript runs in the browser (any browser), while the JSP scriptlet is executed on the server and needs a server with JSP support.

See related links.

Differentiate schema and instance?

Database Instance

The term instance is typically used to describe a complete database environment, including the RDBMS software, table structure, stored procedures and other functionality. It is most commonly used when administrators describe multiple

instances of the same database.Also Known As: environment

Examples: An organization with an employees database might have three different

instances: production (used to contain live data), pre-production (used to test new

functionality prior to release into production) and development (used by

database developers to create new functionality).

RELATION SCHEMA

A relation schema can be thought of as the basic information describing

a table or relation. This includes a set of column names, the data types associated

with each column, and the name associated with the entire table. For example, a

relation schema for the relation called Students could be expressed using the

following representation:

Students(sid: string, name: string, login:

string, age: integer, gpa: real)

There are five fields or columns, with names and types as shown above.

Which option should we adopt to improve the database design of the organisation?

That would depend on what those specific options are. The options can only be determined by examining the flaws within the current database design of the organisation.

How do you create a table using another table including constraints?

If your using Ms SQL, use enterprise manager to export all scripts for a particular table in one file

What is forward pulse current in Led technology?

When a LED is multiplexed, it is energized not all the time, but only for short periods. Let's say it's in a row of three - this would mean it's only on for 33% of the time. If the current remains the same, it's only 33% as bright. By increasing the current, you make it look as bright as if it were on all the time, even though it isn't. This "pulse current" is thus higher than the normal maximum; because it's only applied for such short periods, it will not damage the LED.