SQL Statistical Analsis [closed] - asp.net

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am planning a "statistics" page for a university project where lots of factoids will be displayed based on data from my Access database.
The statistics will be displayed in text format like so:
23% of drinkers enjoyed Life of Pi whilst only 15% of non-drinkers like it.
65% of teachers have read Othello by William Shakespeare whilst only 40% of policemen have read it.
[I have bolded the values I know how to retrieve in an SQL statement, and have italicized the percentages which I don't know how to compute]
User details include Boolean values such as smoker:yes/no or drinker:yes/no as well as the user's profession (there will be a limited number of professions listed in a combobox). These are all stored in a table called 'userprofiles'
I have a separate table called 'booklist' that stores the names,authors,title etc of books as well as a table called 'booklikejunction' where the likes for each book are recorded as well as the user's current User.Identity.Name
What would my SQL statement look like? And how would I display the results of my query in the format I have outlined above?

Just a hint (using ms-access SQL syntax):
select sum(iif([field1]='drinker',1,0)) / count([field1])
from [tbl_questions]
where ...
Not the cleanest way to do it, but it works

Related

quickest way to convert Sqlite Database to MS - Access (2003/7007) Format [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
what can be the quickest way to convert a sqlite database to MS-access format, give that i dont have the table structure of the database.
my best possible guess is
connect to sqlite db, get table schemas, then duplicate the table data row by row.
i need the quickest way possible.
regards
raj
A simple way:
Install an ODBC driver for SQLite
In Access, create linked tables. You will be given the choice of linking to the table or creating a copy of the table and data in Access.

How to keep page view count? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
When I refresh the page, page count does not increase. It is kept in session or any way. For example, in SO, I clicked any qouestion, question view count increase. And I return that question again after look another it is not increase.
What is the logic? And Sorry my poor english. I hope I can explain. I dont know correct tag for this question too.
Thanks.
You may check the IPAddress of the request coming from and check it. If A request already came (page view) from this IP for this page, then do not increase the count, else increase.
If you store it in session it can be hacked by different browsers. Ex: If i open the page in 3 different browsers ,the count will be increased 3 numbers. So do not use Session for that.
You can have a table to do that. Have a QuestionId, IPAddress, DateVisited columns. It is up to you to decide whether the visit should be counted if user visit on a different day from the Same IP for same question . Since you have the data in table, you can do the IF condition as per your wish.

Search box to work like google search [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a sql query that should return results for user text (Like free text search)which can be a single character or word or combination of words.
For example if I have column named "subject" and its value is Very long test, then I want a query that can give result if I put test or t or `e'in the query below
select Subject from [dbo].[Email] where Contains(Subject,'%usertext%')
I tried handling in code behind and then sending it to the query as parameter.
am editing this question because of so many down votes. Please if you dont understand the question simply comment so I can try to ask more clearly. That would be helping me.
You don't need the % character, since the function Contains already implied that.
So :
select Subject from [dbo].[Email] where Contains(Subject,'t')
The % are for LIKE function
select Subject from [dbo].[Email] where Subject LIKE '%t%'

More database traffic than the DataSet? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Forget the other details of the DataSet vs DataReader argument and tell me factually whether using the DataSet saves you from creating as many database queries as the DataReader does?
In my experience, it is clear that using the DataReader requires more database queries than using a DataSet. With the DataSet you can create one query (or stored procedure), disconnect, and then simply query the DataSet, leaving less back-and-forth to the database.
So factually, is the statement true that a DataReader creates more database traffic than a DataSet given the same scenario of cause.
A DataSet uses a DataReader to populate itself.
So the answer is no, a DataReader does not create more database traffic. It is the developer's understanding and usage (or mis-usage) that would create more database traffic.

how to built a database for to sale online? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
well i have a table my boss has made... they are 2 tables..
first where products are going to be has
(table A)
idinvoice (since table B)
idpruduct
description (it is the name of product)
quantity
unitPrice
TotalPrice
another table (i am going to call it table B)
idinvoice
date
deadline
type
idclient
saler (i consider it is sooo bad)
street
transport
status
Total
why do i believe it is bad?
because first the client is going to choose the product (but it doesn't have a idinvoice)
i have never made something as this, only on windows form, but i have never built a online point sale,
how tables do you believe I must to have? (what columns)
You need three tables. They might be something like:
Product: idpruduct, description (it is the name of product), unitPrice
Client: idclient, street
Invoice: idinvoice, idclient, saler, plus everything else related to a shipment or sale of one or more products.
You might also want:
Saler, or salesman: name, idnumber (perhaps idclient, too)
Does this sound close to correct, to start with?

Resources